1
$\begingroup$

There is a table expressing the values of T and x, {T_i,x_i}. T is the function of x, T(x). The another function F depends on T and x, F(T,x). Using the {T_i,x_i} table how the new {F_i,x_i} table can be constructed?

$\endgroup$
1
$\begingroup$
tab = Table[{T@x, x}, {x, 1, 5}]

{f[##], #2} & @@@ tab
{{T[1], 1}, {T[2], 2}, {T[3], 3}, {T[4], 4}, {T[5], 5}}

{{f[T[1], 1], 1}, {f[T[2], 2], 2}, {f[T[3], 3], 3}, {f[T[4], 4], 4}, {f[T[5], 5], 5}}

Or for in-place modification:

tab[[All, 1]] = f @@@ tab;

tab
{{f[T[1], 1], 1}, {f[T[2], 2], 2}, {f[T[3], 3], 3}, {f[T[4], 4], 4}, {f[T[5], 5], 5}}
$\endgroup$
0
$\begingroup$
f1 = Function[x, x*x] (* example first function *)
t1 = {f1[#], #} & /@ Range[5] (* make an example first table *)
f2 = Function[{x, y}, x + y]  (*example second function *)
Map[{f2 @@ #, #[[2]]} &, t1]  (* make an example second table *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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