MathGroup Archive 1998

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

Search the Archive

Re: COMBINING LISTS



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)
  • Prev by Date: How Mathematica select one of the roots?
  • Next by Date: Re: Interesting Simulation Problems....
  • Prev by thread: COMBINING LISTS
  • Next by thread: Re: COMBINING LISTS