我想构造一个分段信号:
t=0:0.0075:2.175;
y1=zeros(size(t));
y2=zeros(size(t));
y3=zeros(size(t));
N=length(t);
for k=1:N;
if t(k)>0&t(k)<0.724;
y=sin(2*pi*50*t);
elseif t(k)>0.725&t(k)<1.449;
y=sin(2*pi*100*t);
else t(k)>1.45&t(k)<2.175;
y=sin(2*pi*150*t);
end
end
plot(t,y)