shahzeb1618
(Shahzeb Kamal)
February 28, 2018, 11:48am
1
Hello,
I am trying to get {Subscript[a, 0], Subscript[a, 1], Subscript[a, x], Subscript[a, x+1]} using the table as follows,
Table[Subscript[a, p], {p, {0, 1, x, x + 1}} ]
But it does not return the last value of p.
This is the output: `{Subscript[a, 0], Subscript[a, 1], Subscript[a, x], 1}
Any help?
Thank you`
fkampas
(Frank Kampas)
February 28, 2018, 1:41pm
2
What version are you using? It works ok in 11.2
In[1]:= Table[Subscript[a, p], {p, {0, 1, x, x + 1}}]
Out[1]= {Subscript[a, 0], Subscript[a, 1], Subscript[a, x], \
Subscript[a, 1 + x]}
mthiel
(Marco Thiel)
February 28, 2018, 3:15pm
3
Hi,
I cannot reproduce that in any of the recent versions of MMA.
Table[Subscript[a, p], {p, {0, 1, x, x + 1}}]
gives
{Subscript[a, 0], Subscript[a, 1], Subscript[a, x], Subscript[a, 1 + x]}
What version are you using? Can you start a new Kernel session?
Best wishes,
Marco
PS: Sorry, the last post only showed up after I had submitted… Sometimes there is a long delay…
shahzeb1618
(Shahzeb Kamal)
February 28, 2018, 3:34pm
4
Hey,
Thanks. Whenever i start a new Kernel session then it works, however i can’t reuse a variable in the same kernel (mathematica is not holding a variable somehow)! I am using 10.4 by the way.
Best wishes,
Shahzeb