MathGroup Archive 2006

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

Search the Archive

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


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?