- #1
jwxie
- 282
- 0
Homework Statement
Suppose f(x,y) = sin(3y-x^2+1)+cos(2y^2-2x)
a) produce a labeled contour plot for -2 <= x <= 2, -1<= y<= 1
b) Based on the contour plot you found in a) estimate the coordinates of two saddle
points of the function in the region S defined in a). Mark the points using the Data
Cursor.
Homework Equations
The Attempt at a Solution
I will attach my code and output image
Code:
x=linspace (-2,2,25); y=linspace (-1,1,25);
[x y]=meshgrid (x,y)
z = sin(3.*y - x.^2 + 1) + cos(2.*y.^2 - 2.*x);
[C h]=contour (x,y,z); % the "handle" matrix [C h] holds the graph for labelling
clabel (C,h); % the clabel function labels the level curves
I don't really know how to tell from the graph. I tried to solve it using second derivative test in matlab, but the solution is very weird, which I can't really use it at this point.
Is it true that the the gap (pointy-gap) between the two lightest green lines are the two saddle points?
Any help is appreciated. Thank you