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.

coneplot• Draw the cones, setting the scale factor to 5 to make the cones larger thanthe default size.• Set the coloring of each cone (FaceColor, EdgeColor).daspect([2,2,1])xrange = linspace(xmin,xmax,8);yrange = linspace(ymin,ymax,8);zrange = 3:4:15;[cx cy cz] = meshgrid(xrange,yrange,zrange);hcones = coneplot(x,y,z,u,v,w,cx,cy,cz,5);set(hcones,'FaceColor','red','EdgeColor','none')Add the Slice Planes• Calculate the magnitude of the vector field (which represents wind speed) togenerate scalar data for the slice command.• Create slice planes along the x-axis at xmin and xmax, along the y-axis atymax, and along the z-axis at zmin.• Specify interpolated face color so the slice coloring indicates wind speed anddo not draw edges (hold, slice, FaceColor, EdgeColor).hold onwind_speed = sqrt(u.^2 + v.^2 + w.^2);hsurfaces = slice(x,y,z,wind_speed,[xmin,xmax],ymax,zmin);set(hsurfaces,'FaceColor','interp','EdgeColor','none')hold offDefine the View• Use the axis command to set the axis limits equal to the range of the data.• Orient the view to azimuth = 30 and elevation = 40 (rotate3d is a usefulcommand for selecting the best view).• Select perspective projection to provide a more realistic looking volume(camproj).• Zoom in on the scene a little to make the plot as large as possible (camzoom).axis tight; view(30,40); axis offcamproj perspective; camzoom(1.5)2-97

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

Saved successfully!

Ooh no, something went wrong!