Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Noah's List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg5687] Re: Noah's List
  • From: killough at convex.com
  • Date: Sat, 11 Jan 1997 14:28:56 -0500
  • Organization: Convex Technology Center of Hewlett Packard, Richardson, Tx USA
  • Sender: owner-wri-mathgroup at wolfram.com

In article <5atsld$ssn at dragonfly.wolfram.com>,
Hans Havermann  <haha at astral.magic.ca> wrote:

>I have two lists, x and y, each containing n elements. I would like to
>generate a new list, {{x[[1]],y[[1]]}, {x[[2]],y[[2]]},...
>{x[[n]],y[[n]]}}, but have been unable to figure out a shorthand for it.
>Any help would be much appreciated.


Thread[{x,y}]


??Thread

Thread[f[args]] ``threads'' f over any lists that appear in args.
   Thread[f[args], h] threads f over any objects with head h that appear in
   args. Thread[f[args], h, n] threads f over objects with head h that appear
   in the first n args. Thread[f[args], h, -n] threads over the last n args.
   Thread[f[args], h, {n, m}] threads over arguments n through m.
Attributes[Thread] = {Protected}


Lee


  • Prev by Date: Reading external files
  • Next by Date: Numerical Solving of a system of equations
  • Previous by thread: Re: Noah's List
  • Next by thread: the mathematica journal