Hi Jan Ali,
It is my understanding that you want to add three signals that are defined only in particular intervels of time. Following code might help you.
t = (-1:0.01:1);
unitstep1=t>=0;
unitstep2=t>=0.1;
unitstep3=t>=0.18;
unitstep4=t>=0.3;
rect1=unitstep1-unitstep2;
rect2=unitstep2-unitstep3;
rect3=unitstep3-unitstep4;
Signal1=sin(2*pi*50*t);
Signal2=sin(2*pi*150*t);
Signal3=sin(2*pi*500*t);
Sc= Signal1*rect1+Signal2*rect2+Signal3*rect3;
0 Comments
Sign in to comment.