Re: How to apply a list of functions
- To: mathgroup at smc.vnet.net
- Subject: [mg112873] Re: How to apply a list of functions
- From: Vince Virgilio <blueschi at gmail.com>
- Date: Mon, 4 Oct 2010 06:06:59 -0400 (EDT)
- References: <i89bv9$jg6$1@smc.vnet.net>
On Oct 3, 3:39 am, Sam Takoy <sam.ta... at yahoo.com> wrote:
> Hi,
>
> As a follow up to my question about apply {Sin, Cos} to x, I came up
> with the tasteless
>
> Map[Apply[#, {x}] &, {Sin, Cos}]
>
> but I expect that the pros in this ng will be able to improve upon it.
>
> Thanks,
>
> Sam
Tangentially,
I've always wondered if there was a better way to apply a list of
functions to a list of arguments. Here's how I do it, where f and x
are the respective lists.
MapThread[#1@#2 &, {f, x}]
Seems performant.
Anyone?
Vince