Question about assignments and variables
(* For example *) SP = SparseArray[{},5] or SP = Range[5]
now we want to work with this array in some another function :
(* example *) Fun[array_]:= array[[3]] = 100 ; (* set cell №3 equal to 100*)
then we eval
Fun[SP]
ERROR! output will be an Error like: Set::write Tag SparseArray in ... is Protected.
So what is the right way to change the arguments of function in function (non-pure-functions)? How to creare analog-like of Part[]
?
maybe smth like:
Clear[f]; f[a_]:=Set[Symbol[a][[3]],100]; A =SparseArray[{},5]; f["A"];
But it's error again