MathGroup Archive 2001

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

Search the Archive

Re: How to convert a list of functions in a list valued function


Suppose your functions are :

f1=#&
f2=#^2&
f3=#^3&

You can define f[x] by :

f[x_]=Through[List[f1,f2,f3][x]]

and then, for instance :
f[2] will give
{2,4,8}

If the functions are defined in a list, i.e.
funlist={f1,f2,f3}

you can use

f[x_]=Through[List[Sequence@@funlist][x]]


On Friday 06 April 2001 07:53, Thomas Neff wrote:
> I have a list of functions, say
>
> funlist = {f1, f2, f3, ..., fn}
>
> I want to construct a function f, so that
>
> f[x] gives the list {f1[x], f2[x], f3[x], ... fn[x]}
>
> f[x_] = funlist[x] doesn't work ;-(
>
> Is there an elegant way to do this in Mathematica ?
>
>
> Thanks
>
> Thomas


  • Prev by Date: Re: Re: Special Matrix
  • Next by Date: Re: Howto vonvert a list of functions in a list valued function
  • Previous by thread: Howto vonvert a list of functions in a list valued function
  • Next by thread: Re: Howto vonvert a list of functions in a list valued function