1
votes

I want to plot a 3d function, say u(x,y,z), where all the variables are independent. Can anyone help me out?

Note : The existing so-called 3d plotting functions usually employ two independent variables and a third dependent one.

For example, x and y are defined independently, and z = x^2 + y^2. Whereas in my case, even z is also an independent variable, and I want to plot u(x,y,z) = x^2 + y^2 + z^2.

1
What do you want this plot to look like? Have you thought about it at all? - David
@David : The function I am writing here is just for an illustration. The one I was looking for may be called as a volume plot, as compared to surface plots. Thankfully the sliceomatic package serve the purpose. I would be glad if a better technique is shared. - Fela Renthlei
So you are trying to plot an isosurface? A function in R^3, a 3D function u(x,y) represents a 2D surface, which we can plot. But to do that in R^4, u(x,y,z), requires a 3D "surface", which is just not possible in our minds on in Matlab. You have to take a simplification, such as, in 3D, a contour plot which lets you represent 3D data in 2D, albeit in a limiting way. The same thing extended to 4D is an isosurface. You can also use other "dimensions", just as colour, or size to give information about the functino value at a point. - David
@David : Thanks for your comment. I hope it will help me for my journey. - Fela Renthlei

1 Answers

2
votes

Sound's like you want to plot a 4D curve/surface: 3 independent variables and the resulting value of your function.

you might find this useful: http://www.mathworks.com/matlabcentral/answers/104616-plot-4d-surface-from-x-y-z-c-data