MathGroup Archive 2006

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

Search the Archive

Re: Map-like behaviour for functions of more than a single argument?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64532] Re: Map-like behaviour for functions of more than a single argument?
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Mon, 20 Feb 2006 22:31:07 -0500 (EST)
  • References: <dtc9po$a5g$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Matt,

In[1]:=
f[#,Sin]&/@{{x1,y1},{x2,y2}}
Out[1]=
{f[{x1,y1},Sin],f[{x2,y2},Sin]}

In general:
In[2]:=
h[#1,#2]&@@@{{x1,y1},{x2,y2}}
Out[2]=
{h[x1,y1],h[x2,y2]}
In[5]:=
h[#[[1]],#[[2]]]&/@{{x1,y1},{x2,y2}}
Out[5]=
{h[x1,y1],h[x2,y2]}

dkr


  • Prev by Date: Code to translate to negative base...
  • Next by Date: Re: Statistical Analysis & Pattern Matching
  • Previous by thread: Re: Map-like behaviour for functions of more than a single argument?
  • Next by thread: Re: Map-like behaviour for functions of more than a single argument?