Hi,
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)
plot(t,y)
axis([0 8*pi -1 1])
grid on
pause(0.1)
hold on
if j ~= length(t)
clf
end
t = t + 0.1;
end
To move to left you can vary j as: j = length(t):-1:1
0 件のコメント
サインインしてコメントする。