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: Re: Converting a list to arguments for a function ---
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Virgil Stokes

Posts: 77
Registered: 3/16/06
Re: Converting a list to arguments for a function ---
Posted: May 7, 2011 7:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.