# Part assignment is not a symbol [duplicate]

read some related posts and found no solution. For a list defined like this

m = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.9, 1.0, 1.5, 1.6};


when I define this function

f[m__] :=m[[Range[2, Length[Evaluate[m]], 1]]] = {{r, x, y, u, v, n, l, w,
s}, m[[Range[2, Length[Evaluate[m]], 1]]]}\[Transpose];


I get an error telling me the list in the part assignment is not a symbol.

I want to be able to build a function that does the operation on different lists and takes the name of the list as an argument.

## marked as duplicate by Lukas Lang, MarcoB, m_goldberg, Alex Trounev, WReachMay 12 at 5:42

• Please explain what are you trying to do. what is f supposed to do? – Kuba May 8 at 8:37
• I'd venture m = Transpose[{{r, x, y, u, v, n, l, w, s}, Rest@m}] will accomplish what it appears you're after... – ciao May 8 at 8:49
• Or, maybe m[[2 ;;]] = Transpose[{{r, x, y, u, v, n, l, w, s}, m[[2 ;;]]}] is what you are trying to do. – LouisB May 8 at 9:21
• Take a look at Hold and evaluation control in general - the Evaluate is not needed in this case for example. The error stems from the fact that m is evaluated to a list before it's passed to f, which causes Part to complain – Lukas Lang May 8 at 11:54
• Possible duplicate of How to modify function argument? - See also Modifying parameters: Set::setps in the part assignment is not a symbol – Lukas Lang May 8 at 11:56

f2[list_] := Transpose[{{r, x, y, u, v, n, l, w, s}, list[[2 ;;]]}]