# How to plot in 4_D?

1 visualización (últimos 30 días)
Preston el 4 de Abr. de 2013
I have a matrix: A(16,24,336). How can I plot this A matrix in 4D? The A matrix is based off the following matrices: D(16,1), T(1,24), and L(336,1). How can I plot D, T, L with the color representing the A values? Or just how could I plot this data in general? I am very new to Matlab and would appreciate as detailed explanation as possible.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (2)

bym el 4 de Abr. de 2013
look at the documentation for
slice
by typing in the command window
doc slice
also, look at the documentation for
meshgrid
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Brady Flinchum el 21 de Mayo de 2013
I think that I have an answer. I have achieved this with the data in a slightly different format
Essentially I had a file that gave me
x0, y0, z0, c0
x0, y1, z0, c1
x0, y2, z0, c2
. . .
. . .
. . .
x1, y0, z0, c_n
x1, y1, z0, c_n+1
. . .
To plot these I use the reshape command:
xq = reshape(x,137,19)
where the 137 is total number between repeats in the x and y, and 19 is the total number of time the pattern repeats, AKA the depth slices.
The reshape command leaves me with 4 137x19 matricies that I called xq, yq, zq, cq. You can then use the surf command to plot your data:
surf(xq,yq,zq,cq)
I hope this helps! I am still trying to figure out how to interpolate my values to a finer mesh.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre 2-D and 3-D Plots 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