How can I create a 3D imagesc plot?

6 次查看(过去 30 天)
em95
em95 2017-12-21
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 个评论
Mohannad Ajamieh
Mohannad Ajamieh 2022-7-22
编辑:Mohannad Ajamieh 2022-7-22
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by