Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Assigning values to a list.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110093] Re: Assigning values to a list.
  • From: Simon Pearce <Simon.Pearce at nottingham.ac.uk>
  • Date: Tue, 1 Jun 2010 07:40:11 -0400 (EDT)

Try,

x == {1,3,5};y=={2,4,6};
Partition[Riffle[x, y], 2]

Simon

-----Original Message-----
From: kevin [mailto:kevin999koshy at gmail.com]
Sent: 01 June 2010 09:24
To: mathgroup at smc.vnet.net
Subject: [mg110093] [mg110085] Assigning values to a list.

Hi Guys,

           I am a newbie to mathematica..Is there anyway to read
values from 2 lists {n by 1} and {n by 1} to a new list {n by 2}
without using loops.. eg say you have x == {1,3,5} any y == {2,4,6}, I
will need a new list z =={{1,2},{3,4},{5,6}}.. Thanks in advance.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


  • Prev by Date: Re: Non-linear Programming - Plot3D
  • Next by Date: Re: Hurwitz Zeta Rational Sequence showing primes in the denominator
  • Previous by thread: Re: Assigning values to a list.
  • Next by thread: Re: Assigning values to a list.