% Generate a 3-D surface plot

% Generate the plot
a = 0:.1:5;
b = a.^1.4;
[x y] = meshgrid(a,b);
z = cos(x) + sin(y);

% Display a surface plot
figure(1)
clf
surf(x,y,z);
shading interp;

% Annotate the plot
title('Interpolated Surface Plot');
xlabel('X');
ylabel('Y');
zlabel('Z');

% Display a mesh plot
figure(2)
clf
mesh(x,y,z);

% Annotate the plot
title('Mesh Plot');
xlabel('X');
ylabel('Y');
zlabel('Z');

% Save a copy
print -f1 -djpeg surfplot
print -f2 -djpeg meshplot
