% contour plot example
% This is handy sometimes
% Here we compare a surface plot and a contour plot of 
% the same function. Note the use of subplot
fcontour_ex = @(x,y) 3./(x.^2 + y.^2 +1) + 4./((x-1).^2+(y-2).^2 +1);
x = -1:.1:3;
y = -1:.1:3;
[X,Y]=meshgrid(x,y);
Z = fcontour_ex(X,Y);
subplot(121) % the left plot of a 1 by 2 plot
 surf(X,Y,Z)
subplot(122) % the right plot of a 1 by 2 plot
 contour(X,Y,Z) 
  