function[] = plt_mov(Nt,Nx)
%
% Nt # of intervals in the t - direction
% Nx # of intervals in the x - direction
%
Tf = 0.5;     % Final time
a = 0;      % Left endpoint
b = 1;      % Right endpoint
%
h = (b-a) / Nx;
tau = Tf / Nt;
tau/h
t = linspace(0,Tf,Nt+1);
x = linspace(a,b,Nx+1);
for j = 1: Nt+1;
    uex = u0(x - t(j));
    plot(x,uex,'r');
    title(['Exact solution for u_t = u_x. Time t = ' num2str(t(j))],'FontSize',16);
    xlabel('x');
    grid on;
    axis([0 1 0 1]);
    M(j) = getframe;
end
movie2avi(M,'ex3.avi','fps',15)
%--------------------------------------------------------

function u0 = u0(x)
% initial data

beta = 100;
u0 = exp(-beta*(x - 0.5).^2);
return