Re: How to create {{x1,y1}, ..., {xn,yn}} data from {x1,...,xn} and {y1, ..., yn}
- To: mathgroup at smc.vnet.net
- Subject: [mg63780] Re: [mg63755] How to create {{x1,y1}, ..., {xn,yn}} data from {x1,...,xn} and {y1, ..., yn}
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 14 Jan 2006 02:32:23 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
x={x1,x2,x3,x4}; y={y1,y2,y3,y4}; Thread[{x,y}] {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}} Transpose[{x,y}] {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}} f[a_,b_,c_,x_]:=Module[{t1,t2}, t1=a*x^2; t2=b*x; t1+t2+c]; f[a,b,c,z] a*z^2 + b*z + c Bob Hanlon > > From: "youngjin.michael at gmail.com" <youngjin.michael at gmail.com> To: mathgroup at smc.vnet.net > Subject: [mg63780] [mg63755] How to create {{x1,y1}, ..., {xn,yn}} data from {x1,...,xn} and {y1, ..., yn} > > Hello, > > I would like to know how to create a table format data such as {{x1, > y1}, {x2, y2}, ..., {xn, yn}} from > {x1, x2, ..., xn} and {y1, y2, ..., yn}. > > I also would like to know if a user-defined function in Mathematica can > have more than one statements in its body. > > Thanks in advance. > > Young-Jin > >