I have a multivariate function that I want to map into a triple of variables.
x = {0.01`, 0.11`, 0.21000000000000002`, 0.31000000000000005`,
0.41000000000000003`, 0.51`, 0.6100000000000001`,
0.7100000000000001`, 0.81`, 0.91`};
y = {1.`, 1.`, 1.`, 1.`, 1.`, 0.9804148800744802`,
0.8196730260718126`, 0.6189620070242443`, 0.40469250572443105`,
0.26901189545273474`};
z = {0.8153370522348216`, 0.8853249359665971`, 0.9223317847713025`,
0.9559380865485229`, 0.9999999995185327`, 1.`, 1.`,
0.9084506972387802`, 0.7345679056105409`, 0.5989011012000781`};
domain = Partition[Flatten[{x, y, z}], 3];
f[x_, y_, z_] := (x + 1.5*y + 1.2*z)/(1 + x);
Map[f, domain]
I want
{f[0.01, 0.11, 0.21], f[0.31, 0.41, 0.51], f[0.61, 0.71, 0.81],
f[0.91, 0.815337, 0.885325], f[0.922332, 0.955938, 1.],
f[1., 1., 0.908451], f[0.734568, 0.598901, 1.], f[1., 1., 1.],
f[1., 0.980415, 0.819673], f[0.618962, 0.404693, 0.269012]}
But for some reason when I Map[f, domain] I get:
{f[{0.01, 0.11, 0.21}], f[{0.31, 0.41, 0.51}], f[{0.61, 0.71, 0.81}],
f[{0.91, 0.815337, 0.885325}], f[{0.922332, 0.955938, 1.}],
f[{1., 1., 0.908451}], f[{0.734568, 0.598901, 1.}], f[{1., 1., 1.}],
f[{1., 0.980415, 0.819673}], f[{0.618962, 0.404693, 0.269012}]}
I have searched the documentation and other posts, but I still cannot figure what is going on with this very simple problem.
f[{x_, y_, z_}]:=....
, or doApply[f, domain, 1]
(in short-hand notation:f @@@ domain
). $\endgroup$ – corey979 Feb 20 '18 at 17:24