Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15974 > unrolled thread

Re: list manipulation

Started byBill Rowe <readnews@sbcglobal.net>
First post2011-02-11 09:19 +0000
Last post2011-02-11 09:19 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: list manipulation Bill Rowe <readnews@sbcglobal.net> - 2011-02-11 09:19 +0000

#15974 — Re: list manipulation

FromBill Rowe <readnews@sbcglobal.net>
Date2011-02-11 09:19 +0000
SubjectRe: list manipulation
Message-ID<ij2uug$7t5$1@smc.vnet.net>
On 2/10/11 at 5:19 AM, andrea.dellapatria@gmail.com (Andrea) wrote:

>hello, I need help about the following question:

>I have two N-dimensional lists:

>list1={x1,x2,...,xN}     list2={y1,y2,...,yN}

>How to create the N-dimrnsional list: list3={{x1,y1},{x2,y2},...,
>{xN,yN}} ?

>I've tried so hard but I didn't work it out!

There are a variety of ways to accomplish what you want. Here
are two:

In[6]:= list1 = RandomInteger[100, {5}];
list2 = RandomInteger[10, {5}];

In[8]:= Transpose@{list1, list2}

Out[8]= {{71, 2}, {17, 4}, {47, 8}, {9, 2}, {99, 5}}

In[9]:= MapThread[List, {list1, list2}]

Out[9]= {{71, 2}, {17, 4}, {47, 8}, {9, 2}, {99, 5}}

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web