x=0:0.1:2*pi;
t=0:0.1:20;
[X,T]=meshgrid(x,t);
v=1;
u=sin(X).*sin(v*T);

figure(1)
fs=20;
set(gca,'FontSize',15)
surf(X,T,u);
xlabel('x','FontSize',fs)
ylabel('t','FontSize',fs)
zlabel('u(x,t)','FontSize',fs)
axis tight;

fprintf('Press any key to continue\n');
pause

figure(2)
lw=2;
set(gca,'FontSize',15)
for ii=1:length(t)
plot(x,u(ii,:),'LineWidth',lw)
axis([min(x) max(x) min(min(u)) max(max(u))])
xlabel('x','FontSize',fs)
zlabel('u(x,t)','FontSize',fs)
drawnow
pause(0.00001)
end
 
