3
$\begingroup$

I have a table with desired inputs of a given function efvc[n,m,u]. I want to calculate for different values of n, m and u. I imported a Excel table with the values I want. Is there a way to call each row of the table as n,m,u inputs on efvc?

{{{0., 0., 6.}, {0.104716, 0.0000884874, 6.}, {0.206578, 0.000825568, 
6.}, {0.301571, 0.000365564, 6.}, {0.410605, 0.0000384834, 
6.}, {0.506678, 0.0000494736, 6.}, {0.610588, 0.000617136, 
6.}, {0.707025, 0.0000728179, 6.}, {0.80244, 0.0000829668, 
6.}, {0.905712, 0.00125702, 6.}, {0.994287, 0.0046171, 6.}}}
$\endgroup$
0
2
$\begingroup$
data = {{{0., 0., 6.}, {0.104716, 0.0000884874, 6.}, {0.206578, 
     0.000825568, 6.}, {0.301571, 0.000365564, 6.}, {0.410605, 
     0.0000384834, 6.}, {0.506678, 0.0000494736, 6.}, {0.610588, 
     0.000617136, 6.}, {0.707025, 0.0000728179, 6.}, {0.80244, 
     0.0000829668, 6.}, {0.905712, 0.00125702, 6.}, {0.994287, 
     0.0046171, 6.}}};

You can Apply (@@@) efvc on level 1 of data[[1]]:

efvc @@@ data[[1]] // Short

{efvc[0., 0., 6.], efvc[0.104716, 0.0000884874, 6.], << 8 >>, efvc[0.994287, 0.0046171, 6.]}

$\endgroup$
1
$\begingroup$

Note that you can also add a new definition for your function to make processing easier:

efvc[{n_, m_, u_}] := efvc[n, m, u]

then it becomes a simple mapping:

efvc /@ data[[1]]

or

Map[efvc, data, {2}]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.