Re: list assignment problem
- To: mathgroup@smc.vnet.net
- Subject: [mg12455] Re: [mg12434] list assignment problem
- From: "Ahmed Maarouf" <maarouf@student.physics.upenn.edu>
- Date: Tue, 19 May 1998 13:31:24 -0400
On Thu, 14 May 1998, Abdallah Rayhan wrote:
>
> Hi Mathematica Lovers,
>
> I am trying to write a program that requires handling 3D list. I am
> faced with this problem which is unable to change the values of the
> list. For example, when I run the following lines, I get this error
> msg: Part::setps: jlist[[1]] in assignment of part is not a symbol.
>
> In[294]:= jlist={{1,2},{3,4}}
>
> Out[294]= {{1, 2}, {3, 4}}
>
> In[295]:= jlist[[1]][[2]]=6
>
> Part::setps: jlist[[1]] in assignment of part is not a symbol.
>
> Out[295]= 6
>
> I would appreciate if any one could tell me what I am doing wrong ?
>
> regards
> Rayhan
>
>
>
The example you gave is for a 2D object. Therefore, if you want to
change jlist from being
{ {1,2} , {3,4} }
to
{ {1,newvalue} , {3,4} }
you should consider doing this instead
jlist[[1,2]] = newvalue;
Hope this works.
Ahmed Maarouf