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

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

View Full Document Right Arrow Icon
Lecture 8: More on Plotting in MATLAB Department of Mathematics University of California, Berkeley Math 98 Introduction to MATLAB programming
Background image of page 1

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

View Full DocumentRight Arrow Icon
Announcements HW2 Solutions are up HW4 is posted.
Background image of page 2
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])
Background image of page 3

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

View Full DocumentRight Arrow Icon
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));
Background image of page 4
Plotting parametric surfaces Surfaces in R 3 Much as we plot parametric curves in
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online