# Is there a way to traverse the indices of @polyvar p11 p12...pnn

**URL:** <https://discourse.julialang.org/t/is-there-a-way-to-traverse-the-indices-of-polyvar-p11-p12-pnn/37096>\
**Category:** General Usage\
**Created:** [April 6, 2020, 7:15am UTC](https://discourse.julialang.org/t/is-there-a-way-to-traverse-the-indices-of-polyvar-p11-p12-pnn/37096 "2020-04-06T07:15:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mforets](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mforets/32/298_2.png) [@mforets](https://discourse.julialang.org/u/mforets)\
**Post date:** [April 6, 2020, 3:29pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-traverse-the-indices-of-polyvar-p11-p12-pnn/37096/4 "2020-04-06T15:29:10Z")

</div>

With `TypedPolynomials` (as in your [other question](https://discourse.julialang.org/t/question-about-computing-the-partial-derivatives-of-a-multivariate-polynomial/36835)), the functionality `@polyvar p[1:n, 1:n]` doesn’t seem to be implemented yet.

However, it is is easy to construct the `Variable`s matrix manually:

```julia
julia> subidx(i) = join(Char.(0x2080 .+ convert.(UInt16, digits(i)[end:-1:1])));

julia> n = 3;

julia> p = hcat([[Variable{Symbol("p", subidx(i), subidx(j))}() for i in 1:n] for j in 1:n]...)
3×3 Array{Variable,2}:
 p₁₁ p₁₂ p₁₃
 p₂₁ p₂₂ p₂₃
 p₃₁ p₃₂ p₃₃

```

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-way-to-traverse-the-indices-of-polyvar-p11-p12-pnn/37096)._
