MathGroup Archive 2010

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

Search the Archive

multiple variables in pure function used in map.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107632] multiple variables in pure function used in map.
  • From: pipehappy <pipehappy at gmail.com>
  • Date: Sat, 20 Feb 2010 06:38:45 -0500 (EST)

Hi, All

Is there a way to use multiple variables in pure function with map.

What I want to do is like this:

ab = {{1, 2}, {2, 3}, {3, 4}};
(#[[1]] + #[[2]]) & /@ ab
{3, 5, 7}

Instead of refer to elements in list I want to use multiple variables
in pure function.

something like this:
ab = {{1, 2}, {2, 3}, {3, 4}};
(#1 + #2) & /@ ab
To do the same thing as the above example.

Best

-- pipehappy


  • Prev by Date: Re: Nested list data extraction bottleneck
  • Next by Date: Matching FillingStyle to PlotStyle
  • Previous by thread: Re: Re: Re: Re: May we trust IntegerQ
  • Next by thread: Re: multiple variables in pure function used in map.