MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: labeling problem


      "p"<>ToString[k]<> "="<>ToString[lst[[k]]],





Bob Hanlon

In article <c0utqu$e60$1 at>, Janos <janos.lobb at> wrote:

<< I need to assign  names to list elements in a nested list based upon 
their position in the nested list.  For example if I have a list:

lst = {{a,b},{c,d},e,f,{g,h,i},j,k,{l.m},{n,o,p},q,{r,s},{{t}}}

pos=Position[lst,{_,_,_}] will give me


Now, I am thinking to assign a unique name to the list elements on 
these positions, like p5={g,h,i} and p9={n,o,p}.  I did not find yet 
how to create variable names with concatenation auto-magically from 
program.  In other programming languages I can do something like this:


and I could refer to it afterward as p5 and its value would be {a,b,c}. 

  • Prev by Date: RE: Bloomberg and Mathematica
  • Next by Date: Re: labeling problem
  • Previous by thread: Re: labeling problem
  • Next by thread: Re: labeling problem