MathGroup Archive 2006

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

Search the Archive

Re: How to extract functions from a list and call them with any argument?


Hallo

With your definition of functionlist

funclist = {Sin[x], x^3, Cos[x]^2};
funclist[[3]] /. x -> t

will give what you want.

Or you could use Pure function definitions. Then

funclist = {Sin, #^3 &, Cos[#]^2 &};
funclist[[3]][t]

will give what you want.

Best regards
Norbert Marxer
www.mec.li


  • Prev by Date: Re: matrix operations -- shared data vs copied
  • Next by Date: Re: How to remove extra empty lines generated when exporting to HTML?
  • Previous by thread: Re: How to extract functions from a list and call them with any argument?
  • Next by thread: Re: How to extract functions from a list and call them with any argument?