%% Negative Feedback Loop with MIMO Systems
% Based on the figure below, consider connecting two MIMO transfer functions with two inputs and two outputs in a negative feedback loop.
%
% For this example, create two random continuous state-space models using rss.

G = rss(4,2,2);
C = rss(2,2,2);
size(G)
size(C)

% Use feedback to connect the two state-space models in a negative feedback loop according to the above figure.

sys = feedback(G,C,-1);
size(sys)

% The resulting state-space model sys is a 2 input, 2 output model with 6 states. The negative feedback loop is completed such that,
% The first output of G is connected to the first input of C
% The second output of G is connected to the second input of C
% Copyright 2019 The MathWorks, Inc.