%% Closed Loop System with Positive Feedback
% Consider a continuous-time state-space model connected to a continuous-time PID controller model with positive feedback.
% For this example, create a randomized continuous-time state-space model P and a PID controller model C with Kp, Ki and Kd values of 3,1 and 2 respectively.

P = rss(3,1,1)
C = pid(3,1,2)

% Use feedback to connect the state-space model to the PID controller with positive feedback.

sys = feedback(P,C,+1)

% The resultant system sys is a state-space model since the model type is determined by the order of precedence. feedback converts the PID controller model K to state-space form before connecting it to the continuous-time state-space model P. For more information, see Rules That Determine Model Type.
% Copyright 2019 The MathWorks, Inc.