I'd like to assign to $a[1],\ldots,a[m]$ ($m$ being defined beforehand) zero values. I tried
Table[a[i], {i, m}] := Table[0, {m}];
but got an error message
Set::write: "Tag Table in Table[Sub[Table[0, {i}]], {i, 2, m}] is Protected.
Correction: Both suggested methods work well but in my particular situation which differs slightly from the above example the former method gives a strange result
m := 4;
SubY[i_] := Subscript[y, i];
Table[SubY[i], {i, m}]
Table[SubY[i] = 0, {i, m}];
Table[SubY[i], {i, m}]
Subscript[y, 2]
{y_1, y_2, y_3, y_4}
{0, 0, 0, 0}
y_2
while the latter method works perfectly well.
m := 4;
SubG[i_] := Subscript[g, i];
Table[SubG[i], {i, m}]
MapThread[(#1 := #2) &, {Table[SubG[i], {i, m}], Table[0, {m}]}];
Table[SubG[i], {i, m}]
Subscript[g, 2]
{g_1, g_2, g_3, g_4}
{0, 0, 0, 0}
0
_in your variables name. If you want to enter y suscripted by 1, you must type y then ^6 then 1 , or use the menus. – andre314 Jan 16 '16 at 11:38Subscriptis tricky even for experienced users. – Mr.Wizard Jan 16 '16 at 22:35