Re: Applying a list of 2D paramters to a mathematica function
- To: mathgroup at smc.vnet.net
- Subject: [mg68085] Re: [mg68043] Applying a list of 2D paramters to a mathematica function
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Sat, 22 Jul 2006 06:24:09 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200607210937.FAA06886@smc.vnet.net>
- Reply-to: murray at math.umass.edu
- Sender: owner-wri-mathgroup at wolfram.com
How about simply adding an additional rule: f[{x_,y_}] := f[x,y] Curry Taylor wrote: > I have (for simplicity) something like this: > > f[x_, y_] := x+y; > > I want to use this function for a variety of parameters in a list: > > indices = {{a,b}, {c,d}, {e,f}, ..} > > so that I get > > {a+b, c+d, e+f, ..} > > Doing the intuitive thing (for me) > > f /@ indices > > results in > > {f[{a, b}], f[{c, d}], f[{e, f}], ..} > > but what I want is > > {f[a, b], f[c, d], f[e, f], ..} > > and that's not what I'm getting. I have tried using Flatten, pure > functions (Slot # and &), different Map functions, nesting at parameters > (like {1} and {2}), and other things but I just can't seem to get what I'm > after. Any help please? > > Thank you, > > Curry > > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Applying a list of 2D paramters to a mathematica function
- From: Curry Taylor <curry@192.168.0.101>
- Applying a list of 2D paramters to a mathematica function