MathGroup Archive 2005

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

Search the Archive

Re: Applying a list of functions to a list of arguments


D M Yates wrote:

> I have a list of functions, and a list of arguments:
> 
> For example,
> f = {f1, f2, f3}
> a = {a1,a2,a3}
> 
> I would like to return
> {f1[a1],f2[a2],f3[a3]}


Hi Derek,

I am sure there is a better solution, but the following seems to work:

Inner[#1[#2]&, f, a, List]

{f1[a1], f2[a2], f3[a3]}

Regards,
Marcus

-- 
He spends most of his time writing, and is currently revising his
autobiography to include himself. -- W. Allen


  • Prev by Date: Re: Log function
  • Next by Date: Re: Log function
  • Previous by thread: Re: Applying a list of functions to a list of arguments
  • Next by thread: Re: Applying a list of functions to a list of arguments