%% BUMPS_SURF uses the MATLAB surf() command to display the bumps function.
%
%  x and y are 1D vectors.
%
x = linspace ( -2.0, + 2.0, 101 );
y = linspace ( -2.0, + 2.0, 101 );
%
%  X, Y, and Z are 2D matrices.
%
[ X, Y ] = meshgrid ( x, y );

Z = bumps ( X, Y );
%
%  SURF makes a 3D plot of Z(X,Y).
%
surf ( X, Y, Z, 'Edgecolor', 'None' );

title ( 'The BUMPS function', 'Fontsize', 16 );
xlabel ( '<-- X -->' );
ylabel ( '<-- Y -->' );
zlabel ( '<-- Z -->' );

print ( '-djpeg', 'bumps.jpg' );
