www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/ShowContoursBelowSurfacePlotExample.m

    %% Show Contours Below Surface Plot
% Show contours below a surface plot by setting the
% |'ShowContours'| option to |'on'|.


f = @(x,y) 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);
fsurf(f,[-3 3],'ShowContours','on')