MathGroup Archive 2002

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

Search the Archive

Re: combining lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32441] Re: combining lists
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sun, 20 Jan 2002 04:28:20 -0500 (EST)
  • References: <a2d2f8$ojh$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Harald,

list1={{x1,y1},{x2,y2},{nx,ny}} ;
list2={{a1,b1},{a2,b2},{an,bn}};

Transpose[{list1, list2}]

        {{{x1,y1},{a1,b1}},{{x2,y2},{a2,b2}},{{nx,ny},{an,bn}}}


--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


"Harald von der Osten-Woldenburg" <hvdosten at lb.netic.de> wrote in message
news:a2d2f8$ojh$1 at smc.vnet.net...
> Hi,
>
> because I feel that I am again and again starting at the same point
> after a while, just a short question.
>
> How can I combine two lists, say:
>
> list1={{x1,y1},{x2,y2},...,{nx,ny}} and
> list2={{a1,b1},{a2,b2},...,{an,bn}}
>
> so that the combination would be:
>
> combined={{{x1,y1},{a1,b1}},{{x2,y2},{a2,b2}},....,{{xn,yn},{an,bn}}}
>
> I tried something like
>
> combi=Join[Take[#2]&,  list1,  Take[#,2]&,  list2]
>
> cimbined=Partition[combi,2]
>
> but without any success. I am sure it is easy but ....
>
> Thanks a lot,
> Harry
>
>
>
>
>




  • Prev by Date: Re: combining lists
  • Next by Date: RE: finding independent variable groups
  • Previous by thread: Re: combining lists
  • Next by thread: RE: combining lists