Re: How to convert a list of functions in a list valued function
- To: mathgroup at smc.vnet.net
- Subject: [mg28308] Re: How to convert a list of functions in a list valued function
- From: Matthias Hertel <wir95cgu at studserv.uni-leipzig.de>
- Date: Mon, 9 Apr 2001 02:58:06 -0400 (EDT)
- References: <200104070744.DAA02024@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Actually, this is a special case of Through:
In[1]:= funlist = {f1, f2, f3};
In[2]:= Through[funlist[x]]
Out[2]= {f1[x], f2[x], f3[x]}
Regards
Matthias
Mariusz Jankowski <mjkcc at usm.maine.edu> writes:
> 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
>
> Thomas, what you want is to Map the following pure function #[x]& over your
> list of functions:
>
> f[x_] := Map[ #[x]&, {f1,f2,f3,f4}]
>
> Mariusz
- References:
- Re: How to convert a list of functions in a list valued function
- From: Mariusz Jankowski <mjkcc@usm.maine.edu>
- Re: How to convert a list of functions in a list valued function