clear all;
clc;
k=0;
%%循环10次
while(k~=10)
i=1;
t=k:0.01:(k+i);%0-1s时
y=sin(2*pi*i*t);
plot(t,y);%蓝线表示周期为1时的曲线
hold on;
t=(k+i):0.01:(k+i+1);%0-2s时
y=sin((i+1)*t);
plot(t,y,'r');%红线表示周期为1时的曲线
hold on;
t=(k+i+1):0.01:(k+i+2);
y=sin((i+2)*t);%0-3s时
plot(t,y,'g');%绿线表示周期为1时的曲线
hold on;
k=k+1;%执行完一次循环,k+1
end
温馨提示:答案为网友推荐,仅供参考