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

    %% Update Simulink Model with All Tuned Parameters     

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

%% 
% Specify the tuning goals and necessary analysis points. 
tg1 = TuningGoal.StepTracking('r','y1m',5);

addPoint(st,{'r','y1m'});

tg2 = TuningGoal.Poles();
tg2.MaxFrequency = 10;  

%% 
% Tune the controller. 
[sttuned,fSoft] = systune(st,[tg1 tg2]);  

%% 
% After validating the tuning results, update the model to use the tuned
% controller values. 
writeBlockValue(sttuned);