plotting a 4d graph as a series of 3d slices

2 visualizaciones (últimos 30 días)
Christopher
Christopher el 1 de Jul. de 2011
Comentada: Matlabuser el 19 de Nov. de 2014
I am measuring the intensity of a set of power meter readings over a 3d space. I am currently running a scan of 50x50 points in the x and y directions at a given z point and recording the intensity at each step.
This works and i can plot a surf, or a pcolor fine.
What I want to do now is take a series of scans at different z points, I would like to display all of this data on a 3d graph displaying the pcolor (or something similar) graph for each z point as a plane.
I have been looking at the slice function but have not been able to get it to work.
Basically I have:
Xpoints = 50x50 double, Ypoints = 50x50 double, Readings = 50x50 double,
at point z1
and i will have a series of these at different z values.
Can somebody help me with formatting this data so that I can use slice with the full set of z values or have any suggestions about how I should do this?

Respuesta aceptada

Patrick Kalita
Patrick Kalita el 5 de Jul. de 2011
I think you will want to use the surface command. The idea is that you can set the Z-data to a single number (well, really an appropriately sized array containing all the same value) so that it is flat, and then use the fourth input argument to surface that controls the color.
Here's a simple example:
% One data set
[x1, y1] = meshgrid(1:50);
reading1 = rand(50);
z1 = 1;
% Another data set
[x2, y2] = meshgrid(1:50);
reading2 = rand(50);
z2 = 2;
% Draw
surface(x1, y1, z1*ones(size(x1)), reading1);
surface(x2, y2, z2*ones(size(x2)), reading2);
view(3)
  1 comentario
Matlabuser
Matlabuser el 19 de Nov. de 2014
Hi, I also tried to use the same algorithm on my data. But I have a problem, I want to see my data as image plot. If I use the same procedure, It shows my value of reading1 as grid plot. but I want that in image plot. Can you please tell me how can I do this ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by