12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sliceSlicing with a Nonplanar SurfaceYou can slice the volume with any surface. This example probes the volumecreated in the previous example by passing a spherical slice surface throughthe volume.[xsp,ysp,zsp] = sphere;slice(x,y,z,v,[-2,2],2,-2) % Draw some volume boundariesfor i = -3:.2:3hsp = surface(xsp+i,ysp,zsp);rotate(hsp,[1 0 0],90)xd = get(hsp,’XData’);yd = get(hsp,’YData’);zd = get(hsp,’ZData’);delete(hsp)hold onhslicer = slice(x,y,z,v,xd,yd,zd);axis tightxlim([-3,3])view(-10,35)drawnowdelete(hslicer)hold offendThe following picture illustrates three positions of the spherical slice surface asit passes through the volume.2-448

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!