matlab中怎么让坐标轴动起来?

2025-01-08 06:27:56
推荐回答(1个)
回答1:

% 给个例子参考哈
clear all
t=1:0.1:20;x=2*sin(t)+5;k=0;
figure;
plot(t,x);grid on
while 1
if k>max(x)
break;
end
k=k+0.2;
axis([k+2*pi,k+4*pi,0,10]); %移动坐标系
pause(0.1);
end