MathGroup Archive 2006

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

Search the Archive

Re: Modify a list of pure functions


. schrieb:
> Hi all,
> 
> I have a problem where I need to build up a list of pure functions that
> have been modified from a base pure function.  I'm not having much luck
> in getting it to work correctly, and was wondering if anyone had some
> good ideas.  A toy version of the problem is:
> 
> f = Sin[#]&
> listF = Table[(i f[##])&, {i, 5}]
> 
> What I'd hope to get is listF containing:
> {Sin[##]&, (2 Sin[##])&, (3 Sin[##])&, (4 Sin[##])&, (5 Sin[##])&}


Evaluate with ## and refunction the resulting Table

f = Sin[#]&

listF = Function@@@Table[{i f[##]}, {i, 5}]

	{Sin[#1] &, 2 Sin[#1] &, 3 Sin[#1] &, 4 Sin[#1] &, 5 Sin[#1] &}

or still more compact

Function/@(f[##]*Range[1,5])

-- 

Roland Franzius


  • Prev by Date: ShadowPlot3D
  • Next by Date: RE: FindRoot, suppressing complex interval-numbers
  • Previous by thread: ShadowPlot3D
  • Next by thread: RE: FindRoot, suppressing complex interval-numbers