A vibrating rectangular drums

The following commands create and show the vibrating drumhead $u(x,y,t) = \sin(x)\sin(y)\cos(\sqrt 2 \,t),\ 0 < x,y< \pi,\ 0 < t < 2 \pi$. In the animation, $t = n\pi/50$.

X = 0:0.1:pi; Y = 0:0.1:pi; Z = transpose(sin(X))*sin(Y);
for n = 0:200
    surf(cos(n*pi/100)*Z)
    axis([0 35 0 35 -1 1 -1 1])
    set(gca,'XTick',[],'YTick',[])
    M(n+1) = getframe;
end
mplay(M,20)

(I am suppressing the output of the mplay commands.)

Here is the vibrating drumhead $u(x,y,t) = \sin(4*x)\sin(2*y)\cos(\sqrt {20}
		     \,t),\ 0 < x,y< \pi,\ 0 < t < 2 \pi$. The graph has been rotated so you can see the nodal lines. In the animation, $t = n\pi/50$.

X = 0:0.1:pi; Y = 0:0.1:pi; Z = transpose(sin(4*X))*sin(2*Y);
for n = 0:200
    surf(cos(sqrt(20)*n*pi/100)*Z)
    axis([0 35 0 35 -1 1 -1 1])
    view(-88,64)
    set(gca,'XTick',[],'YTick',[])
    M(n+1) = getframe;
end
mplay(M,20)