Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: Thread? Through? Operate?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32405] Re: [mg32388] Thread? Through? Operate?
  • From: "Helge Andersson" <helgea at inoc.chalmers.se>
  • Date: Sat, 19 Jan 2002 01:16:42 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Johannnes,
Here is one solution 

In[1]:=
f={Sin, Cos, Exp};
arg={Pi/2,-Pi,1}
#1[#2]&@@@Transpose[{f, arg}]
Out[1]:=
{1,-1,e}

Helge Andersson
Chalmers
Sweden


Johannes Wrote:
Dear MathGroup members,
I have a list of n unnamed functions

f = {expr1 &, expr2 &,... ,exprn &}
(each function has exactly one arguement.
and a list of n arguments.

arg = {arg1, arg2,... ,argn}

I simply want to apply each function expri &
to the respective argument argi in order 
to obtain the list of function values fi.
Is there no more elegant way than the following one?

Map[#[[1]][#[[2]]]&, Transpose[{f,arg}]

Thanks,
	Johannes





  • Prev by Date: Re: Thread? Through? Operate?
  • Next by Date: Re: path problem
  • Previous by thread: Re: Thread? Through? Operate?
  • Next by thread: Re: Thread? Through? Operate?