How can I create a 3D imagesc plot?

7 ビュー (過去 30 日間)
em95
em95 2017 年 12 月 21 日
編集済み: Mohannad Ajamieh 2022 年 7 月 22 日
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 Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by