 % BOTH POSITIVE EIGENVALUES

% f(x,y)=x^2+y^2
figure(1); clf;
ezsurf('x.^2+y.^2',[-2 2 -2 2],60);
title('$x^2+y^2$','Interpreter','latex');
axis([-2 2 -2 2 0 20]);
disp('Plotted function is f(x,y)=x^2+y^2');
pause;

% f(x,y)=x^2+3y^2
figure(1); clf;
ezsurf('x.^2+3*y.^2',[-2 2 -2 2],60);
title('$x^2+3y^2$','Interpreter','latex');
axis([-2 2 -2 2 0 20]);
disp('Plotted function is f(x,y)=x^2+y^2');
pause;

 % f(x,y)=x^2+xy + y^2
figure(1); clf;
ezsurf('x.^2+x*y+y.^2',[-2 2 -2 2],60);
title('$x^2+xy+3y^2$','Interpreter','latex');
axis([-2 2 -2 2 0 20]);
disp('Plotted function is f(x,y)=x^2+y^2');
pause;

% BOTH NEGATIVE EIGENVALUES

% f(x,y)=-x^2-y^2
figure(1); clf;
ezsurf('-x.^2-y.^2',[-2 2 -2 2],60);
title('$-x^2-y^2$','Interpreter','latex');
axis([-2 2 -2 2 -8 8]);
disp('Plotted function is f(x,y)=-x^2-y^2');
pause;

% ONE POSITIVE AND ONE NEGATIVE EIGENVALUE

% f(x,y)=x^2-y^2
figure(1); clf;
ezsurf('x.^2-y.^2',[-2 2 -2 2],60);
title('$x^2-y^2$','Interpreter','latex');
axis([-2 2 -2 2 -8 8]);
disp('Plotted function is f(x,y)=x^2-y^2');
pause;

% ONE ZERO EIGENVALUE

% f(x,y)=10(y-x)^2
figure(1); clf;
ezsurf('10*(y-x).^2',[-2 2 -2 2],60);
title('$10(y-x)^2$','Interpreter','latex');
axis([-2 2 -2 2 -20 20]);
disp('Plotted function is f(x,y)=x^2-y^2+x+y');
pause;


% f(x,y)=x^2
figure(1); clf;
ezsurf('10*x.^2-0.*y.^2',[-2 2 -2 2],60);
title('$x^2-y^2+x+y$','Interpreter','latex');
axis([-2 2 -2 2 -20 20]);
disp('Plotted function is f(x,y)=x^2-y^2+x+y');
pause;


% f(x,y)=x^2-y^2+x+y
figure(1); clf;
ezsurf('10*y.^2-0.*x.^2',[-2 2 -2 2],60);
title('$x^2-y^2+x+y$','Interpreter','latex');
axis([-2 2 -2 2 -20 20]);
disp('Plotted function is f(x,y)=x^2-y^2+x+y');
pause;

% BOTH ZERO EIGENVALUES
% f(x,y)=x^3-3*x*y.^2
figure(1); clf;
ezsurf('x.^3-3*x*y.^2',[-2 2 -2 2],60);
title('$x.^3-3xy^2$','Interpreter','latex');
axis([-2 2 -2 2 -20 20]);
disp('Plotted function is f(x,y)=x^3-3*x*y.^2 (monkey saddle)');
pause;

