www.gusucode.com > mpc 案例源码 matlab代码程序 > mpc/RemoveOutputDisturbanceFromOutputChannelExample.m
%% Remove Output Disturbance from Particular Output Channel %% % Define a plant model with no direct feedthrough, and create an MPC % controller for that plant. plant = rss(3,3,3); plant.D = 0; MPCobj = mpc(plant,0.1); %% % Retrieve the default output disturbance model from the controller. distMod = getoutdist(MPCobj); %% % Remove the integrator from the second output channel. Construct the new % output 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)]); setoutdist(MPCobj,'model',distMod) %% % When removing an integrator from the output disturbance model in this way, use % |sminreal| to make the custom model structurally minimal. %% % View the output disturbance model. tf(getoutdist(MPCobj)) %% % The integrator has been removed from the second channel. The % disturbance models for channels |1| and |3| remain at their default % values as discrete-time integrators.