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

MathGroup Archive 1997

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

Search the Archive

Re: Map

  • To: mathgroup at smc.vnet.net
  • Subject: [mg7465] Re: [mg7454] Map
  • From: "C. Woll" <carlw at u.washington.edu>
  • Date: Thu, 5 Jun 1997 01:35:49 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Sean,

You almost had it. Try

Map[f[#,3]&,array]

You need the & to make it a pure function.

Carl

On Wed, 4 Jun 1997, Sean Ross wrote:

> Does anyone know how to use Map if the mapping function has more than one
> argument?
> 
> ie:  If I have a function f[x] and an array, then Map[f,array] applies f to each
> element of the array.  What I want is a function f[x,y] and do something like
> Map[f[#,3],array] so it will apply f[x,3] to every element of the array.  I currently
> have two kludgey work arounds which is to make a new function g[x_]:=f[x,3]
> then use Map[g,array] or to make a newarray={array,list of second arguments},
> then use MapThread..  I am looking for a better way
> 
> Please reply to seanross at worldnet.att.net
> 
> 



  • Prev by Date: Details on Mma 3.0 numerics
  • Next by Date: Re: Ordered Pairs
  • Previous by thread: Details on Mma 3.0 numerics
  • Next by thread: Re: Map