How can I create a 3D imagesc plot?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Mohannad Ajamieh
le 22 Juil 2022
Modifié(e) : Mohannad Ajamieh
le 22 Juil 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
Réponses (0)
Voir également
Catégories
En savoir plus sur Scatter Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!