I make a list of 5 empty $3 \times 3$ matrices via
Table[m[i]=IdentityMatrix[3]-IdentityMatrix[3],{i,1,5}]
However when I want to change an entry via
m[2][[3,4]]=5
I get an error which reads:
Set::setps: m[2] in the part assignment is not a symbol. >>
Any ideas? Thanks
m = ConstantArray[0, {5, 3, 3}]and then dom[[2, 3, 4]] = 1? – J. M.'s missing motivation Mar 30 '17 at 05:37m[2]is not a symbol itself, but a reference to one of theDownValues of the symbolm, this is what you get. – Marius Ladegård Meyer Mar 30 '17 at 05:42DoandTable, we don't useTablejust for side effects ;) – Marius Ladegård Meyer Mar 30 '17 at 05:43m[2] = ReplacePart[m[2], {3, 4} -> 5]but that copies the whole ofm[2]so I would prefer @J.M. 's suggestion. – Marius Ladegård Meyer Mar 30 '17 at 05:49