First, write out the four matrices of the state-space model for the two systems separately, then call feedback() to establish the feedback connection, and finally call step() to test the step response curve of the overall system.
%% Feedback connection between two state-space systems
%% feedback();
%% step();
%%%%%%%%%%%
clear all;
clc;
close all;
%%%%%%%%%%%%%
%% System 1
A1=[-1.03 -1.05;
0.42 -1.08];
B1=[1;0];
C1=[1.1 1.2];
D1=[0.5];
%%% System 2
A2=[-1.06 0.31;
-1.52 -1.08];
B2=[0;1];
C2=[1.2 0.4];
D2=[0.4];
[A3,B3,C3,D3]=feedback(A1,B1,C1,D1,A2,B2,C2,D2);
sys3=ss(A3,B3,C3,D3);
t1=0:0.01:40;
[y3,t3]=step(sys3,t1);
figure(1);
plot(t3,y3,’b-‘);
title(‘Feedback Connection Output’);
xlabel(‘t(s)’);
ylabel(‘y’);
legend(‘Feedback Connection Output’);
grid on;
grid on;
%%%%
disp(‘End.’);