Borrar filtros
Borrar filtros

How to plot a surface with gridded data of x,y,z, and p vectors?

1 visualización (últimos 30 días)
Khandker Ishtiaq
Khandker Ishtiaq el 31 de En. de 2017
Respondida: Steven Lord el 31 de En. de 2017
I have four vectors (x,y,z, and p; p=f(x,y,z)) and all of them are 3-D arrays of size 61 X 61 X 61.I want to draw a surface of p from the values of x, y, and z. The p surface can be defined using color map that any one can read the map from the corresponding values of x, y, z. I have tried the surf command but it did not work. Can anyone please suggest me a way of mapping the p surface based on the data.

Respuestas (2)

John D'Errico
John D'Errico el 31 de En. de 2017
Editada: John D'Errico el 31 de En. de 2017
What are you going to plot? And wha are you planning on using to view it with?
Remember that you are using a monitor, or a piece of paper, so a 2-dimensional viewer. You can visualize a 3 dimensional thing in two dimensions, but don't forget that even that can be misinterpreted. Look at any number of optical illusions, or an M.C. Escher print for examples.
The point is, you can look at a picture of a 3 dimensional thing, and understand it, visualize it. We do this all the time. But often, to understand the shape of something just from a picture, we would need to see it from various angles.
But you have a FOUR dimensional thing. FOUR dimensions. Can you look at a 4-dimensional thing? Your eyes don't see like that.
Tools like plot3 or surf won't work here. They are not designed to work in 4 dimensions. Unless of course, you have a hyper-dimensional monitor. I did have one for a while, but it broke. And did you ever try to get parts for those things? It looks like they use the holodeck all the time on the TV show, but do you have any idea often those things break down? :) Starfleet command is so slow at sending out spare parts.
Seriously, you cannot plot in 4 dimensions. It could be worse though. You might be trying to visualize something in 5 or 12 dimensions.
That does not say there is NOTHING you can do. You could look at iso-surfaces, thus the set of points (x,y,z), such that p(x,y,z) is a constant. Think of this as a contour plot, but now living in 3-dimensions. So instead of a curved line in the (x,y) plane, an iso-surface here is a curved 2-manifold, living in 3 dimensions.

Steven Lord
Steven Lord el 31 de En. de 2017
I think you want either a set of slice planes or an isosurface. The first two items in the Examples and How To section on this documentation page will demonstrate the MATLAB functions used to perform those techniques.

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by