MathGroup Archive 2011

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

Search the Archive

Re: list manipulation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116327] Re: list manipulation
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 11 Feb 2011 04:14:38 -0500 (EST)

list1 = Array[a, 10];
list2 = Array[b, 10];

Thread[{list1, list2}]

{{a[1], b[1]}, {a[2], b[2]}, {a[3], b[3]}, {a[4], b[4]}, {a[5],
   b[5]}, {a[6], b[6]}, {a[7], b[7]}, {a[8], b[8]}, {a[9],
   b[9]}, {a[10], b[10]}}

or

Transpose@{list1, list2}

{{a[1], b[1]}, {a[2], b[2]}, {a[3], b[3]}, {a[4], b[4]}, {a[5],
   b[5]}, {a[6], b[6]}, {a[7], b[7]}, {a[8], b[8]}, {a[9],
   b[9]}, {a[10], b[10]}}

Bobby

On Thu, 10 Feb 2011 04:19:50 -0600, Andrea <andrea.dellapatria at gmail.com>
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!
>
> Tanks in advance for your support
>
> Andrea
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: 3D surface plots - non deletion of data inside undesirable Range
  • Next by Date: Re: list manipulation
  • Previous by thread: Re: list manipulation
  • Next by thread: Re: list manipulation