%
% make a movie, visualizing the solution of u_tt=u_xx
%
N=1024;
x=[0:N]/N;
%
figure(1)
set(gcf,'position',[50, 100, 700, 400])
%
movObj=QTWriter('movie_1.mov');
    % open a file for writing the movie
nframe=250;   % number of frames
dt=0.008;   % time increment for each frame
%
for n=1:nframe,
  t=(n-1)*dt;
  u=0.8*sin(4*pi*x)*cos(6*pi*t);
  clf reset
  axes('position',[0.10, 0.15, 0.85,0.75])
  plot(x, u,'b-','linewidth',2.0);
  set(gca,'fontsize',14)
  axis([0, 1, -1.1, 1.1])
  xlabel('x')
  ylabel('u(t)')
  drawnow
  writeMovie(movObj,getframe(gcf));
end
%
close(movObj);   % close the file
%
%
