Re: {x},{y} -> {x,y} ?
- To: mathgroup at smc.vnet.net
- Subject: [mg68268] Re: {x},{y} -> {x,y} ?
- From: Peter Pein <petsie at dordos.net>
- Date: Mon, 31 Jul 2006 03:45:31 -0400 (EDT)
- References: <eaht5b$or5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
AngleWyrm schrieb: > Hi, > I have two lists, a set of x values and a set of y values. How do I convert > them to one list of { {x1,y1},{x2,y2} } pairs? > > Hello, Transpose is your friend: In[1]:= {xl, yl} = #1 /@ Range[5]& /@ {x, y}; Transpose[{xl, yl}] Out[2]= {{x[1], y[1]}, {x[2], y[2]}, {x[3], y[3]}, {x[4], y[4]}, {x[5], y[5]}} Peter