www.gusucode.com > slcontrol 案例源码程序 matlab代码 > slcontrol/ObtainClosedLoopTransferFunctionfromReferencetoPlantOutpExample.m
%% Obtain Closed-Loop Transfer Function from Reference to Plant Output % Obtain the closed-loop transfer function from the reference signal, |r|, % to the plant output, |y|, for the |ex_scd_simple_fdbk| model. %% % Open the |ex_scd_simple_fdbk| model. mdl = 'ex_scd_simple_fdbk'; open_system(mdl); %% % In this model: % % $$\begin{array}{l} % K(s) = {K_p} = 3\\ % G(s) = \frac{1}{{s + 5}} % \end{array}$$ % %% % Create an |slLinearizer| interface for the model. sllin = slLinearizer(mdl); %% % To obtain the closed-loop transfer function from the reference signal, % |r|, to the plant output, |y|, add both points to |sllin|. addPoint(sllin,{'r','y'}); %% % Obtain the closed-loop transfer function from |r| to |y|. sys = getIOTransfer(sllin,'r','y'); tf(sys) %% % The software adds a linearization input at |r|, |dr|, and a linearization % output at |y|. %% % % <<../getiotransfer_r2y.png>> % %% % |sys| is the transfer function from |dr| to |y|, which is equal to $(I+GK)^{-1}GK$.