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

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?