www.gusucode.com > control 案例程序 matlab源码代码 > control/InitializeControlSystemDesignerUsingArrayOfPlantModelsExample.m

    %% Initialize Control System Designer Using Array of Plant Models
%%
% Specify a configuration template.
initconfig = sisoinit(2);
%%
% Specify model parameters.
m = 3;
b = 0.5;
k = 8:1:10;
T = 0.1:.05:.2;
%%
% Create an array of LTI objects to model variations in plant |G|.
for ct = 1:length(k);
    G(:,:,ct) = tf(1,[m,b,k(ct)]);
end
%%
% Assign |G| to the initial configuration.
initconfig.G.Value = G;
%%
% Specify initial compensator value.
initconfig.C.Value = tf(1,[1 2]);
%%
% Use a graphical Bode editor to tune the open-loop response.
initconfig.OL1.View = {'bode'};
%%
% Open Control System Designer using the specified configuration settings.
%
%   controlSystemDesigner(initconfig)
%
%%
%
% <<../sisoinit_example2.png>>
%
%%
% By default, the template for configuration 2 also opens a Bode editor for
% tuning the closed-loop response.