MathGroup Archive 2011

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

Search the Archive

Re: Converting a list to arguments for a function ---

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118676] Re: Converting a list to arguments for a function ---
  • From: Virgil Stokes <vs at it.uu.se>
  • Date: Sat, 7 May 2011 07:30:58 -0400 (EDT)

On 06-May-2011 13:55, Leonid Shifrin wrote:
> Virgil,
>
> use Apply:
>
> In[1]:= Apply[f, {4, 1, 1}]
>
> Out[1]= f[4, 1, 1]
>
> It also has an abbreviation: @@
>
> In[2]:= f @@ {4, 1, 1}
>
> Out[2]= f[4, 1, 1]
>
> Regards,
> Leonid
>
>
> On Fri, May 6, 2011 at 3:24 PM, Virgil Stokes <vs at it.uu.se 
> <mailto:vs at it.uu.se>> wrote:
>
>     Suppose I have a list,
>
>     list = {4,1,1}
>
>     and I wish to use it as follows
>
>     f[4,1,1]
>
>     Is there a simple way (without looping through the elements list) to transfer
>     the elements of list to the arguments for f?
>
>
>
>
>
Thanks to all who answered my question. I apologize for posting such a simple 
question, one that I should have obviously been able to answer myself. 
Sometimes, especially after being away from Mathematica for awhile, I have 
trouble with things that should not be that hard.

Best regards,
--V


  • Prev by Date: Re: Converting a list to arguments for a function --- How?
  • Next by Date: Iterative process using IsotopeData.
  • Previous by thread: How to use NIntegrate to integrate a purely numeric vector function?
  • Next by thread: Iterative process using IsotopeData.