# How to create a matrix with specific element subscripts and input subscripts into function as arguments

I'd like to create a matrix with specific elements subscripts. Matrix is like below.

This matrix is sized at M*M and subscripts are indexed by (m-n,n). And I need to input subscripts into function as arguments.

I got this idea because I know the List in Mathematica can operate listablly. But I'm not sure this kind of subscripts is achievable.

Basically speaking, all I need to do is just to input subscripts(i.e.(m-n,n)) as arguments and fetch the results(i.e. Lambda(x,y)) to save them into this matrix at corresponding position. But how can I assign these specific subscripts to elements?

Is this what you are looking for?

M=3;
Table[Which[
col<row,0,
True,Subscript[λ,col-row,row]
],{col,0,M},{row,0,M}]


which returns

{{Subscript[λ, 0, 0], 0,                  0,                  0},
{Subscript[λ, 1, 0], Subscript[λ, 0, 1], 0,                  0},
{Subscript[λ, 2, 0], Subscript[λ, 1, 1], Subscript[λ, 0, 2], 0},
{Subscript[λ, 3, 0], Subscript[λ, 2, 1], Subscript[λ, 1, 2], Subscript[λ, 0, 3]}}


without more fiddling and time I can't make those subscripts into tiny digits, but it appears to be what you are asking for when I evaluate that in a notebook.

• Thanks a lot Bill! Jul 5 '20 at 3:43
ClearAll[array]
array[m_Integer, n_Integer] :=
Array[If[# < #2, 0, Subscript[λ, # - #2, #2]] &, {m, n}, {0, 0}]

MatrixForm @ array[5, 5]


TeXForm @ MatrixForm@array[5, 5]


$$\left( \begin{array}{ccccc} \lambda _{0,0} & 0 & 0 & 0 & 0 \\ \lambda _{1,0} & \lambda _{0,1} & 0 & 0 & 0 \\ \lambda _{2,0} & \lambda _{1,1} & \lambda _{0,2} & 0 & 0 \\ \lambda _{3,0} & \lambda _{2,1} & \lambda _{1,2} & \lambda _{0,3} & 0 \\ \lambda _{4,0} & \lambda _{3,1} & \lambda _{2,2} & \lambda _{1,3} & \lambda _{0,4} \\ \end{array} \right)$$

This is very easy to do with SparseArray:

Normal @ SparseArray[{{i_, j_} /; i >= j :> Subscript[λ, i - j, j - 1]}, {5, 5}]