%% Plot the Contour Lines of a Symbolic Expression
%% 1

syms x y
f = 3*(1-x)^2*exp(-(x^2)-(y+1)^2)... 
   - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2)... 
   - 1/3*exp(-(x+1)^2 - y^2);

%
%% 2

ezcontour(f,[-3,3],49)

% Copyright 2015 The MathWorks, Inc.