MathGroup Archive 1998

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

Search the Archive

Re: lists



Paul.Hanson@colorado.edu wrote:
> 
> Hola!
>   So, if you have a couple of lists:
>   {{1},{2},{3},{4}....{n}}
> and
>   {{1a},....{na}}
> and I want to combine them such that,
>   {{1},{1a},{2},{2a}....{n},{na}}
> 
> How do I get there?  Thanks in advance for the help.
> 
> Paul Hanson
> 
> --
>                                  * *
>                                 *    *
>                            /\    */\*
>                           /  \   /  \ /\

Using Flatten and Transpose will work.

In[2]:=
a={{1},{2},{3},{4}}
Out[2]=
{{1},{2},{3},{4}}
In[3]:=
b={{a1},(a2),{a3},{a4}}
Out[3]=
{{a1},a2,{a3},{a4}}
In[4]:=
Flatten[Transpose[{a,b}],1]
Out[4]=
{{1},{a1},{2},a2,{3},{a3},{4},{a4}}


Bruce Wolk



  • Prev by Date: RE: Method to eliminate NIntegrate warning
  • Next by Date: a simple algebraic system of 5 eqns second degree
  • Prev by thread: Re: lists
  • Next by thread: Re: lists