Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

%----Obtaining unit-step, unit-impulse, end unit-ramp responses---------------

% ***** Unit-step responses of three systems *****


num1 =|0 O 1J; deni « [1 0.2
II;
num2 » (0 0.8 1]; den2 = [1
1 1J;
num3 *=[0 0 1]; den3 * [1
1 1J;
d * step(num1,den1,t); c2 =
step(num2,den2,t); c3 *
stBp(num3,den3,t);
ptot(t,c1/-\t,c2/x', t,c3/o*) grid
titfeCUnit-Step Responses')
xlabeK't Sec') ylabeiCcl. c2, c3')
text(4.2, 1.7, 'System 1')
text(4.2,1.3/System 2')
text(3,0.9/System 3')

% ***** Unit-impulse responses of three systems


9•

x1 — impuise(num1,den1,t); x2 = imp ulse (num2,den2,t) ; x3


* impulse{num3fden3,t);
plotftxl /-'#tfx2/x% tr*3/o*) grid
tide ('Unit-impulse Responses') xlabeif't Sec’) ytabei(*x1# x2,
x3') text(3,0.5,'System 1r) text(0.8.-0.1/System 2') text{4.1.
0.1 /System 3')

% ***** Unit-ramp responses of three systems **

numlr *=[0 0 0 1J;


denlr *= [1 . 0.2 1 0];
num2r *=[0.0 0.8 1];.
den2r-.l1 1 1 01;
pum3r *[0 0 0 1J;
den3r - [ 1 . 1 1 01;
yl * step<num1r,den1rrt);
y2 = step(num2r,den2rft);
y3 — step(num3rfden3r,t);
pkrt(t,t/-\t,y1/-',t,y2/x\ t,y3/o')
grid
tlde('Unit-Ramp Responses') xlabeiit Sec')
YtobeK’yl. y2, y3') text(2.5,5.5/System V) text(6.2,4.5, ’System
2') text(4.8»2.5/Systern 3')

You might also like