MathGroup Archive 2008

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

Search the Archive

Re: Convert Array to Simple List


Pierre wrote:
> I need to convert an Array (List of List) to a simple List by concatening the colums or the lines.
> 
> e.g. : {{a,b},{c,d}}  ==>{a,b,c,d}
> or
> {{a,b},{c,d}}  ==>{a,c,b,d}


In[1]:= m = {{a, b}, {c, d}};

In[2]:= Flatten@m

Out[2]= {a, b, c, d}

In[3]:= Flatten@Transpose@m

Out[3]= {a, c, b, d}


Regards,
-- 
Jean-Marc




  • Prev by Date: Re: symbolic evaluation
  • Next by Date: Re: Convert Array to Simple List
  • Previous by thread: Re: Convert Array to Simple List
  • Next by thread: Re: Convert Array to Simple List