Lecture8

Lecture8 - Lecture 8 More on Plotting in MATLAB Department...

This preview shows pages 1–6. Sign up to view the full content.

Lecture 8: More on Plotting in MATLAB Department of Mathematics University of California, Berkeley Math 98 Introduction to MATLAB programming

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Announcements HW2 Solutions are up HW4 is posted.
Plotting curves in 3d plot3 We saw last time how plot parametric plane curves with the plot command. We can use the plot3 in the analogous way. Consider the example of the helix curve: >> t=linspace(0,2*pi); >> x=cos(t); >> y=sin(t); >> z=t; ezplot3 This is command is analogous to ezplot . The basic syntax format is ezplot3(funx,funy,funz,[tmin,tmax])

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Plotting z = f ( x,y ) surf To plot the function f : [ a,b ] × [ c,d ] R we use the commands x=linspace(a,b); y=linspace(c,d); [X,Y]=meshgrid(x,y); surf(X,Y,f(X,Y)); where f is ”vectorized” (i.e. takes in vector arguments in MATLAB). mesh , meshc , . . . There are a variety of ways to spice up surf . For example x=linspace(-pi,pi); y=x; [X,Y]=meshgrid(x,y); mesh(X,Y,cos(X).*sin(Y));
Plotting parametric surfaces Surfaces in R 3 Much as we plot parametric curves in

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

Lecture8 - Lecture 8 More on Plotting in MATLAB Department...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online