MatLab-Homework2

# MatLab-Homework2 - 2. Use fplot to create a plot of f ( x )...

This preview shows page 1. Sign up to view the full content.

Homework 6: Graphics This week, you will create four plots, and submit them along with a diary ﬁle containing your work for all four problems. Be sure to clean up your diary ﬁle and label the problems within it (alternatively, you can submit four diary ﬁles, one for each of the four problems). 1. Create a single plot on the interval [ - 2 , 2] containing three functions: f ( x ) = e - x 2 , g ( x ) = 1 - x 2 and h ( x ) = 1 - x 2 + 1 2 x 4 . Please color each function diﬀerently and also choose diﬀerent linestyles as well. Label each curve with its formula using the text command.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Use fplot to create a plot of f ( x ) = x sin x 1 + x 2 on the interval [-30 , 30]. 3. Create a polar plot of r = cos(4 t )-2 sin 3 ( t/ 3). Use linspace to create a vector of 1000 points between 0 and 6 π . 4. Use surfc to create a surface plot with a contour plot beneath it for the function z = cos( x + y ) e-( x 2 + y 2 ) / 2 for-2 π ≤ x ≤ 2 π ,-2 π ≤ y ≤ 2 π . You can create a meshgrid as follows: u=-2*pi:0.1:2*pi; [X,Y]=meshgrid(u,u); Then deﬁne Z as a function of X and Y ....
View Full Document

## This note was uploaded on 04/19/2011 for the course MATH 21126 taught by Professor Johnson during the Spring '11 term at Carnegie Mellon.

Ask a homework question - tutors are online