0
$\begingroup$

Let's say I have

x = 1; y = 2;

d = x^2 + y^5 ;

and

x = 5; y = 3;

d = x^2 + y^5 ;

and

x = 8; y = 5;

d = x^2 + y^5;

and

x = 6; y = 24;
d = x^2 + y^5;

and

x = 12; y = 0;
d = x^2 + y^5;

now, is there any way I can save the values of d for given x and y and plot it in ListPlot, without using Loop/Table/Map/NesteList etc.

I do not want to use loop/Table/Map/NestedList and then stored (by using Reap and Sow) the values in d and ListPlot. The reason is that I am trying to make GUI and the original equation is PDE and using FEM. So, the memoryuse is too much.

$\endgroup$

1 Answer 1

1
$\begingroup$

One possible way could be:

pts = {{1, 2}, {5, 3}, {8, 5}, {6, 24}, {12, 0}};
res = {First@#, Last@#, (First@#)^2 + (Last@#)^5} & /@ pts
Show[
 ListPointPlot3D[res, PlotStyle -> Red]
 , ListPlot3D[res, PlotStyle -> Opacity[0.1]]
 ]

enter image description here


Or you could define a function:

f[x_, y_] := x^2 + y^5;
res2 = Transpose[Transpose[pts]~Join~{f @@@ pts}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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