Re: Converting a list to arguments for a function --- How?
- To: mathgroup at smc.vnet.net
- Subject: [mg118694] Re: Converting a list to arguments for a function --- How?
- From: "cedric.fuhrer" <cedric.fuhrer at laposte.net>
- Date: Sat, 7 May 2011 07:34:15 -0400 (EDT)
Hello, I find this : Apply[f,{1,4,4}] or more quickly you can do this: f@@{1,4,4} These 2 possibilities return the output: f[1,4,4] and it's that you want! And if the list is longer, it's ok too. > Message du 06/05/11 13:40 > De : "Virgil Stokes" > A : mathgroup at smc.vnet.net > Copie =C3 : > Objet : [mg118666] Converting a list to arguments for a function --- How? > > > 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 tran= sfer > the elements of list to the arguments for f? Une messagerie gratuite, garantie =C3 vie et des services en plus, =C3= =A7a vous tente ? Je cr=C3=A9e ma bo=C3=AEte mail www.laposte.net Une messagerie gratuite, garantie =C3 vie et des services en plus, =C3= =A7a vous tente ? Je cr=C3=A9e ma bo=C3=AEte mail www.laposte.net