www.gusucode.com > mpc 案例源码 matlab代码程序 > mpc/RemoveInputDisturbanceForParticularChannelExample.m

    %% Remove Input Disturbance for Particular Channel
% Define a plant model with no direct feedthrough.

plant = rss(3,4,4);
plant.D = 0;
%% 
% Set the first input signal as a manipulated variable and the remaining 
% inputs as input disturbances.

plant = setmpcsignals(plant,'MV',1,'UD',[2 3 4]);
%% 
% Create an MPC controller for the defined plant.

MPCobj = mpc(plant,0.1);
%% 
% Retrieve the default input disturbance model from the controller.

distMod = getindist(MPCobj);
%% 
% Remove the integrator from the second input disturbance. Construct the 
% new input disturbance model by removing the second input channel and setting 
% the effect on the second output by the other two inputs to zero.

distMod = sminreal([distMod(1,1) distMod(1,3); 0 0; distMod(3,1) distMod(3,3)]);
setindist(MPCobj,'model',distMod)
%% 
% When removing an integrator from the input disturbance model in this way, 
% use |sminreal| to make the custom model structurally minimal.
% 
% View the input disturbance model. 

tf(getindist(MPCobj))
%% 
% The integrator has been removed from the second channel. The first and 
% third channels of the input disturbance model remain at their default values 
% as discrete-time integrators.