How can I generate a plane to use with the SLICE command which is appropriately sized in MATLAB 7.8 (R2009a)?
Afficher commentaires plus anciens
I am using the SLICE command to slice my data with a plane at a particular angle. I create a plane and then rotate it (with the ROTATE command) appropriately. However, the resulting plane is too small and I cannot see the volumetric data on the slice.
[x,y,z] = meshgrid(0:0.05:4.5 ,0:0.1:2.3,1:1:3000);
v = x.*exp(-x.^2-y.^2-z/100.^2);
xmin = min(x(:)); ymin = min(y(:));
xmax = max(x(:)); ymax = max(y(:));
hslice = surf(linspace(xmin,xmax,100),...
linspace(ymin,ymax,100),...
zeros(100));
rotate(hslice,[1,0,0],90)
rotate(hslice,[0,0,1],45)
xd = get(hslice,'XData');
yd = get(hslice,'YData');
zd=get(hslice,'ZData');
delete(hslice)
h = slice(x,y,z,v,xd,yd,zd);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Volume Visualization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!