0% found this document useful (0 votes)
94 views1 page

Plotting Piecewise Signal Task

The document defines a piecewise signal with 6 segments over the time intervals from -5 to 5 seconds. It generates the x-values for each time segment using different functions and concatenates them into a single vector x along with the corresponding t-values. It then plots the piecewise signal versus time with a linewidth of 2.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views1 page

Plotting Piecewise Signal Task

The document defines a piecewise signal with 6 segments over the time intervals from -5 to 5 seconds. It generates the x-values for each time segment using different functions and concatenates them into a single vector x along with the corresponding t-values. It then plots the piecewise signal versus time with a linewidth of 2.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LAB TASK # 3 :: PLOTTING OF PIECEWISE SIGNAL

t0=-5:0.01:-3;
x0=zeros(size(t0));
t1=-3:0.01:-2;
x1=-t1-3;
t2=-2:0.01:-1;
x2=ones(size(t2));
t3=-1:0.01:0;
x3=2*ones(size(t3));
t4=0:0.01:1;
x4=ones(size(t4));
t5=1:0.01:2;
x5=-t5+2;
t6=2:0.01:5;
x6=zeros(size(t6));
x=[x0 x1 x2 x3 x4 x5 x6];
t=[t0 t1 t2 t3 t4 t5 t6];
plot(t,x,'linewidth',2);
Piecewise Signal
2

1.5

Amplitude

0.5

-0.5

-1
-5

-4

-3

-2

-1

0
Time

You might also like