%% Wave traveling to right
X = 0:0.01:2*pi;
for n = 0:100
    plot(X,sin(X-n*pi/50));
    axis([0 2*pi -2 2])
    wave_right(n+1) = getframe;
end

%% Wave traveling to left
X = 0:0.01:2*pi;
for n = 0:100
    plot(X,sin(X+n*pi/50));
    axis([0 2*pi -2 2])
    wave_left(n+1) = getframe;
end