function stringeqMovie
    clear;clf;
    tmax=10;
    w=1/2;
    t=0:tmax/100:tmax;
    x=0:0.01:10;

    for k=1:length(t)
        plot(x,dalambert(x,t(k)))
        axis([0,10,-10,10])
        M(k)=getframe
    end
    movie(M,2)
        
    function y=dalambert(x,t)
        for j=1:length(x)
            if t==0 z=0;
            else s=x(j)-w*t:w*t/20:x(j)+w*t;
                z=trapz(s,psi(s));
            end
            y(j)=(phi(x(j)-w*t)+phi(x(j)+w*t))/2+z/(2*w);
        end
    end
    
    function y=phi(x)
        if x>=2 & x<=(3*pi)/2
            y=(x-2)^2*(cos(x))^3;
        else y=0;
        end
    end
	
	 function y=phi_odd(x)
        if 0<=x && x<=10
            y=phi(x);
        else if -10<=x && x<0
                y=-phi(-x);
            end
        end
    end

    function y=psi(x)
        for i=1:length(x)
            y(i)=0;
        end
    end


end

