%an example of a 3D surface plot
K = 6;
B = K*pi;
x_space = [-B:1:B];
y_space = [-B:1:B];
[X, Y] = meshgrid(x_space, y_space);
%We get X, Y - the coordinate arrays for the mesh
% USE THOSE TO COMPUTE THE Z VALUES!
FPS = 30;
time = 60*30;
for i = 1:FPS*time
    theta = pi*i/30;
    Z = sin(sqrt(X.^2 + Y.^2)-theta);
    surf(X,Y,Z); %can use surf or mesh
    axis equal;
    axis([-1.3*B,1.3*B,-1.3*B,1.3*B,-1.3,1.3,-1.3,1.3]);
    %set up: x-axis: -3 to 3
    %        y-axis: -3 to 3
    %        z-axis: -9 to 9
    %color axis: blue at -10, red at 10
    pause(1/FPS);
end;