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

    %% Query Value of All Tuned Elements in slTuner Interface with Custom Parameterizations

% Copyright 2015 The MathWorks, Inc.


%% 
% Create an |slTuner| interface for the |scdcascade| model. 
open_system('scdcascade');
st = slTuner('scdcascade',{'C1','C2'});

%%
% Set a custom parameterization for tuned block |C1|.
C1CustParam = realp('Kp',1) + tf(1,[1 0]) * realp('Ki',1);
setBlockParam(st,'C1',C1CustParam);

%% 
% Typically, you would use a tuning command such as |systune| to tune the 
% values of the parameters in the custom parameterization.

%%
% After tuning, use |getTunedValue| to query the tuned values of the
% parameterizations of all the tuned blocks in |st|.
S = getTunedValue(st)

%%
% The tuned values are returned in a structure that contains fields for:
%%
% 
% * The tuned block, |C2|, which is parameterized as a Control Design
% Block.
% * The tunable elements, |Kp| and |Ki|, within block |C2|, which is
% parameterized as a custom |genss| model.
%