2
$\begingroup$

I have a function which is defined with an integral and a sum, in other words, its numerical, so i want to make a table (nxm) with the following entries:

data={{x1,y1,f[x1,y1]},{x1,y2,f[x1,y2],{x2,y2,f[x2,y2],...,{xn,ym,f[xn,ym]}

Is there an easy way of achieving this? Thanks!

$\endgroup$
3
$\begingroup$
f[x_, y_] := Sin[x y]
ListPlot3D@ Flatten[Table[{x, y, f[x, y]}, {x, 0, 2 Pi, 2 Pi/50}, {y, 0, 2 Pi, 2 Pi/50}], 1]

Mathematica graphics

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you, the flatten was the thing i was missing. $\endgroup$ – Josh Nov 19 '14 at 19:58

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.