Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Renameing Variables' topicStudent Support Forum > General > "Renameing Variables"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
12/17/12 1:58pm

In[1]:= l={a,b,c,d,e};
l2=Table[ToExpression[ToString[l[[i]]]<>"u"],{i,1,Length[l]}]

Out[2]= {au,bu,cu,du,eu}

In[3]:= l3=Table[ToExpression[ToString[l[[i]]]<>ToString[i]],{i,1,Length[l]}]

Out[3]= {a1,b2,c3,d4,e5}

But this ONLY works IF you have not assigned any values to a,b,c,... You can assign a=4 and then do either of these and see what you get.

URL: ,

Subject (listing for 'Renameing Variables')
Author Date Posted
Renameing Variables Sebastian 12/10/12 1:08pm
Re: Renameing Variables Bill Simpson 12/17/12 1:58pm
< Previous CommentHelp | Reply To Comment | Reply To Topic