% Chapter 3: Figure 3.36
%
%   The time response for nonzero initial
%   conditions and zero input using lsim.
%
A=[0 -2;1 -3]; B=[2;0]; C=[1 0]; D=[0];
sys=ss(A,B,C,D);
x0=[1 1];
t=[0:0.01:1];
u=0*t;
[y,T,x]=lsim(sys,u,t,x0);
subplot(121), plot(T,x(:,1)), grid
xlabel('Time (s)'), ylabel('X_1')
subplot(122), plot(T,x(:,2)), grid
xlabel('Time (s)'), ylabel('X_2')