www.gusucode.com > slcontrol 案例源码程序 matlab代码 > slcontrol/ObtainNegativeFeedbackTransferFunctionAtAnalysisPointExample.m

    %% Obtain Negative-Feedback Loop Transfer Function at Analysis Point  
% Obtain the negative-feedback loop transfer function, calculated at |e|,
% 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 loop transfer function at |e|, add this point to |sllin|
% as an analysis point. 
addPoint(sllin,'e');  

%% 
% Obtain the loop transfer function at |e|. 
sys = getLoopTransfer(sllin,'e',-1);
tf(sys) 

%%
% The software adds a linearization output, breaks the loop, and adds a
% linearization input, |de|, at |e|.
%
% <<../getlooptransfer_e.png>>
%

%%
% |sys| is the transfer function from |de| to |e|. Because the third input
% argument indicates negative-feedback, the software returns |sys| as $GK$.