This works:
Table[Subscript[x, j], {j, 1, 10}]
But this doesn't:
x = Table[Subscript[x, j], {j, 1, 10}]
Giving this warning:
$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Subscript[x, 1]. >>
Can someone explain why this happens?
Students can do this of course:
Clear[x,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]
x={x1,x2,x3,x4,x5,x6,x7,x8,x9,x10};
But what's the easiest way (for students just starting to use Mathematica) to enter x1, x2, through x100 and store them in the variable x?
x
in terms ofx
; hence the error. UseIndexed[]
instead. $\endgroup$xs = Array[x, 100]
, which is how I would do it. If you insist onSubscript
s, doxs = Array[Subscript[x,#]&, 100]
$\endgroup$Indexed
or simplyx[i]
for the win. $\endgroup$