Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Applying a list of functions to a list of arguments
Replies: 7   Last Post: May 26, 2005 4:35 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bobby R. Treat

Posts: 405
Registered: 12/8/04
Re: Applying a list of functions to a list of arguments
Posted: May 25, 2005 6:25 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Inner[Compose,f,a,List]

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

or

#1[#2]&@@@Thread@{f,a}

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

or

#1[#2]&@@@Transpose@{f,a}

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

Bobby

On Tue, 24 May 2005 05:12:47 -0400 (EDT), D M Yates <yatesd@mac.com> 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]}
>
> I thought this should easy, but am stumped. Obviously the lists are of
> equal, but arbitrary length, and the arguments may or may not be atomic
> expressions. In my particular case, the arguments are likely to be
> combinations of Real, and List[Real,...], but I hope this is
> irrelevant.
>
> Any suggestions?
>
> Many thanks,
>
> Derek Yates
>
>
>
>




--
DrBob@bigfoot.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2010. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Goodwin College of Professional Studies.