% Defines matrices suitable for plotting surfaces

[X Y] = meshgrid(-3:0.2:3,-2:0.2:2);   % creates matrices of suitable x and y values
Z = (X.^2 +3*Y.^2).*exp(1-X.^2-Y.^2);  % computes the corresponding z values 

surf(X,Y,Z)
