Re: COMBINING LISTS
- To: mathgroup@smc.vnet.net
- Subject: [mg12248] Re: [mg12207] COMBINING LISTS
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Tue, 5 May 1998 03:29:43 -0400
- References: <199805010708.DAA00108@smc.vnet.net.>
Knut Henning Schroder wrote:
>
> I have two lists:
> list1={a,b,c,d,...} and list2={x,y,z,...} I want to combine the two
> lists for ListPlot in Mathematica ListPlot[{{a,x},{b,y},{c,z},....}]
> Please let me know a simple way to do this.
>
> Regards,
check out the commands Thread, Map, Inner, MapThread,Transpose,
RotateRight etc. whenever you are trying to manipulate lists.
list1={a,b,c,d}; list2={x,y,z,aa};
Inner[List,list1,list2,List]
MapThread[List,{list1,list2}]
Transpose[{list1,list2}]
all return
{{a,x},{b,y},{c,z},{d,aa}}
- References:
- COMBINING LISTS
- From: Knut.Schroder@chembio.ntnu.no (Knut Henning Schroder)
- COMBINING LISTS