First, write out the four matrices of the two systems separately, then call series() to connect the two systems, and finally test the step signal output result of the connected system.
% State space model connection
% series()
%%%%%%%%%%%
clear all;
clc;
close all;
%%%%%%%%%%%%%
%%% System 1
A1=[-2.2 -2.3;
0.6 -3.5];
B1=[1;0];
C1=[1.5 1.2];
D1=[0.5];
%%% System 2
A2=[-1.2 0.3;
-1.4 -2.5];
B2=[0;1];
C2=[1.8 0.6];
D2=[1.5];
[A3,B3,C3,D3]=series(A1,B1,C1,D1,A2,B2,C2,D2);
sys3=ss(A3,B3,C3,D3);
t1=0:0.01:30;
[y3,t3]=step(sys3,t1);
figure(1);
plot(t3,y3,’b-‘);
title(‘Connected Output’);
xlabel(‘t(s)’);
ylabel(‘y’);
legend(‘Connected Output’);
grid on;
grid on;
%%%%
disp(‘End.’);