To make the plot move, you will need to keep updating the ‘t’ vector in for/while loop and then plot the sine wave.
For example, this will move the plot to the right:
for j = 1:length(t)
axis([0 8*pi -1 1])
if j ~= length(t)
t = t + 0.1;
To move to left you can vary j as: j = length(t):-1:1