This function defines an exponential ``hill'' centered at and an exponential ``valley'' centered at . It's not too hard to visualize what an ``elevation map'' of this function would look like. Sketch your guess and then try the following.

% Plotting 2D data with contour close all; clear all; points = linspace(-2,2,40); % 40 equally spaced points between [X Y] = meshgrid(points,points); % Create two arrays, x & y Z = 1./exp((X-.5).^2+Y.^2)-1./exp((X+.5).^2+Y.^2); contour(X,Y,Z,30) % The fourth argument says "draw 30 contours"The command

`meshgrid`

is new. It fills the two arrays and
with the and coordinates, respectively, for each point in the plot
(that is, each is a array of 1600 numbers).
Also new is the `./`

operator. It means to