%% Plant and Controller with Unit Feedback
% pendulumModelAndController.mat contains a SISO inverted pendulum transfer function model G and its associated PID controller C.
%
% Load the inverted pendulum and controller model to the workspace.

load('pendulumModelAndController','G','C');
size(G)
size(C)

% Use feedback to create the negative feedback loop with G and C.

sys = feedback(G*C,1)

% sys is the resultant closed loop continuous-time transfer function obtained using negative feedback. feedback converts the PID controller model C to a transfer function before connecting it to the continuous-time transfer function model G. For more information, see Rules That Determine Model Type.
% Copyright 2019 The MathWorks, Inc.