How can I create a 3D imagesc plot?

8 visualizaciones (últimos 30 días)
em95
em95 el 21 de Dic. de 2017
Editada: Mohannad Ajamieh el 22 de Jul. de 2022
A file output from a simulation I'm running is a 225x64 matrix data file made up of 15 2D 'slices' (each slice being 60x15), which combine to form a 3D structure (60x15x15). I've written a script which takes the 225x64 matrix data file and converts it to a 3D matrix (60x15x15), then plots each of the 15 'slices' as an imagesc plot (as shown in the picture). Is there a way for me to plot this as a 3D imagesc plot with visible selected internal slices, similar to that of the volumetric slice plot?
Volumetric Slice Plot: https://uk.mathworks.com/help/matlab/ref/slice.html
  1 comentario
Mohannad Ajamieh
Mohannad Ajamieh el 22 de Jul. de 2022
Editada: Mohannad Ajamieh el 22 de Jul. de 2022
try this code to generate 3d matrix.
names=dir('name of the file where your pic are saved\*.format of pics');
for i=1:size(names,1)
I(:,:,i)=imread(strcat('name of the file where your pic are saved\',names(i).name));
for j=0:size(names,1)
Img_3D=surface('XData',[0 15;0 15],'YData',[15 15;0 0],'ZData',[j j;j j], 'CData' ,flipdim(im2double(I(:,:,i)),i),'FaceColor','texturemap','EdgeColor','none');
colormap(gray)
end
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Scatter 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