% Problem 3.12

disp('Problem 3.12')
disp(' ')
disp('States space model')
A=[ 0  1; -2 -3]
B=[0; -1]
C=[1 0; 0 1]
D=[0; 0]
x0=[-1; 0]
t=0:0.1:10;

% 3.12(b) - The system transfer function
[num,den]=ss2tf(A,B,C,D,1);
disp(' ')
disp('3.12(b) - The system transfer function')
printsys(num,den,'s')

% 3.12(c) - Unit step response
[y1,x1]=step(A,B,C,D,1,t);
[y2,x2]=initial(A,B,C,D,x0,t);
plot(t,y1+y2)
grid
xlabel('time [secs]')
ylabel('output')
[xc,yc]=ginput(1)
text(xc,yc,'y1')
[xc,yc]=ginput(1)
text(xc,yc,'y2')


