MathGroup Archive 2005

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

Search the Archive

Re: how to map function with over 1 arguments to list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57223] Re: how to map function with over 1 arguments to list
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sat, 21 May 2005 02:39:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 5/20/05 at 4:44 AM, xiaoxun at gmail.com (xun) wrote:

>g[x_]:=x^2; g/@{1,2,3} results in{1,4,9}

>similarly, how to map f[x_,y_]:=x+y; to {1,1},{2,2}?

>it seems that f/@{{1,1},{2,2}} doesn't work.

use MapThread, i.e.

In[4]:= MapThread[f, {{1, 1}, {2, 2}}]
Out[4]= {3, 3}
--
To reply via email subtract one hundred and four


  • Prev by Date: Non linear System of inequalities
  • Next by Date: Re: how to map function with over 1 arguments to list
  • Previous by thread: Re: how to map function with over 1 arguments to list
  • Next by thread: Re: how to map function with over 1 arguments to list