CS 1371 Lecture 17: Surface Plotting and Bodies of Rotation Tips and Examples

21 views5 pages

Document Summary

Surface plotting and bodies of rotation tips and examples. Example: how would i find the global maximum of the function: cofs = [-0. 25 0. 25 -1. 7 6. 6 -1. 83]; xplot = linspace(0,3); yplot = polyval(cofs,xplot); Determine the two independent parameters for doing the plotting. Usually: x and y, r and theta, theta and z. Determine the correct functional form for xx, yy, and zz. Meshgrid vs. surf x = 0:10; y = 5:8; Graph it x = 0:10; y = 5:8; [xx yy] = meshgrid(x,y); zz = zeros(4,11); mesh(xx,yy,zz) surf(xx,yy,zz) Mesh() shows the lattice of points that are plotted. Surf() shows a solid surface connecting all the points directly, with a color scheme that can be preset. Inputs must be 3d x, y, and z arrays of the same size! [xx yy] = meshgrid(x,y); zz = 3*xx - 2*yy; surf(xx,yy,zz); mesh(xx,yy,zz); Graph this equation: x = linspace(-10,10); y = linspace(-10,10); [xx yy] = meshgrid(x,y); zz = yy. ^2/16 - xx. ^2/25; surf(xx,yy,zz);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers