MathGroup Archive 2001

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

Search the Archive

Re: Howto vonvert a list of functions in a list valued function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28299] Re: [mg28253] Howto vonvert a list of functions in a list valued function
  • From: "Mark Harder" <harderm at ucs.orst.edu>
  • Date: Sat, 7 Apr 2001 03:45:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Thomas,
    As you have defined it, funlist is only a list of undefined expressions
f1,f2, etc., i.e. they are *not* functions.  To define a mapping as a list
of functions numbered as you wish, I would do this with one function
definition:

In[426]:= Clear[x];
            nFunc = 10;
            f[x_] = Table[ToExpression["f" <> ToString[i] <> "[x]" ], {i,
nFunc} ]

Out[428]= {f1[x], f2[x], f3[x], f4[x], f5[x], f6[x], f7[x], f8[x], f9[x],
f10[x]}

or, for example,
In[430]:=  f[x_] = Table[ToExpression["Exp[" <> ToString[i] <> " x]" ], {i,
nFunc} ]
                f[a]

Out[430]=
{E^x, E^(2*x), E^(3*x), E^(4*x), E^(5*x), E^(6*x), E^(7*x), E^(8*x),
E^(9*x), E^(10*x)}
Out[431]=
{E^a, E^(2*a), E^(3*a), E^(4*a), E^(5*a), E^(6*a), E^(7*a), E^(8*a),
E^(9*a), E^(10*a)}

mark harder
harderm at ucs.orst.edu


-----Original Message-----
From: Thomas Neff <t.neff at gsi.de>
To: mathgroup at smc.vnet.net
Subject: [mg28299] [mg28253] Howto vonvert a list of functions in a list valued
function


>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 Neff
>Gesellschaft fuer Schwerionenforschung (GSI)
>Email: t.neff at gsi.de   -   PGP key available
>WWW:  http://theory.gsi.de/~tneff/tneff.html
>



  • Prev by Date: Re: Manipulating Strings
  • Next by Date: Re: Manipulating Strings
  • Previous by thread: Re: 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