Re: How to create this kind of list
- To: mathgroup at smc.vnet.net
- Subject: [mg122137] Re: How to create this kind of list
- From: "Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com>
- Date: Sun, 16 Oct 2011 07:06:25 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j7bm30$35r$1@smc.vnet.net>
On Sat, 15 Oct 2011 11:08:32 +0100, Szymon Roziewski <szymon.roziewski at gmail.com> wrote: > Hello there, > I am thinking about creating such a list. > I have 2 lists with the same number of elements. > The idea is to create one list which was taken from these previous two > ones > in the following way: > Take one element of the first list and one from another and put it into > result list {{x1,y1},{x2,y2},...,{xn,yn}}. > Input lists: > A={x1,x2,...,xn} > B={y1,y2,...,yn} > > All best, > Szymon Roziewski a = Array[x, 5]; b = Array[y, 5]; lst = Transpose[{a,b}] gives {{x[1], y[1]}, {x[2], y[2]}, {x[3], y[3]}, {x[4], y[4]}, {x[5], y[5]}}