MathGroup Archive 1997

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

Search the Archive

Re: Noah's List


At 04:22 PM 1/7/97 +0000, you wrote:
>I have two lists, x and y, each containing n elements. I would like to
>generate a new list, {{x[[1]],y[[1]]}, {x[[2]],y[[2]]},...
>{x[[n]],y[[n]]}}, but have been unable to figure out a shorthand for it.
>Any help would be much appreciated.
>
>--
>HaHa
>Rarebit Dreams
>
>
>

here is a simple but elegant way due to N. Blachman

list1={x1,x2,x3,x4,x5}
list2={y1,y2,y3,y4,y5}
Transpose[{list1,list2}]

of course, one could use a for loop and brute force.

Sherman C. Reed
>



  • Prev by Date: Re: Noah's List
  • Next by Date: Mathematica on Daystar
  • Previous by thread: Re: Noah's List
  • Next by thread: Re: Noah's List