function [] = transport1d(N,M)

   h = 2/N;
   for i = 1:N
      x(i) = -1+(i-1)*h;
      phi(i) = sin(pi*x(i));
   end
   plot(x,phi,'o-')
   pause

   dt = h;
   for step = 1:M
      rhs(1) = (phi(1)-phi(N))/h;
      for i = 2:N
         rhs(i) = (phi(i)-phi(i-1))/h;
      end
      phi = phi-dt*rhs;
      plot(x,phi,'o-')
      pause(0.1)
   end

end
