Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2188 > unrolled thread

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

Started byVirgil Stokes <vs@it.uu.se>
First post2011-05-07 11:30 +0000
Last post2011-05-07 11:30 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Converting a list to arguments for a function --- Virgil Stokes <vs@it.uu.se> - 2011-05-07 11:30 +0000

#2188 — Re: Converting a list to arguments for a function ---

FromVirgil Stokes <vs@it.uu.se>
Date2011-05-07 11:30 +0000
SubjectRe: Converting a list to arguments for a function ---
Message-ID<iq3ahf$fds$1@smc.vnet.net>
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@it.uu.se 
> <mailto:vs@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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web