Compare two MPC objects
compares the contents of the two MPC objects
yesno = compare(
mpcobj2 given as input arguments. If the design specifications
(models, weights, horizons, etc.) are identical, then the returned value
yesno is equal to 1.
compare may return
yesno = 1 even if the two
objects are not identical. For instance,
mpcobj1 may have been
mpcobj2 may have not, so that they may have
different sizes in memory. In any case, if
yesno = 1, the behavior of
the two controllers will be identical.
Create two MPC controllers with different control horizons and compare them.
plant=zpk(,2,1); % create plant mpcverbosity off; % turn off MPC messaging mpcobj1=mpc(plant,0.1,10,2); % create an mpc controller with a control horizon of 2 steps mpcobj2=mpc(plant,0.1,10,3); % create an mpc controller with a control horizon of 3 steps compare(mpcobj1,mpcobj2) % compare the controllers ans = logical 0
mpcobj1— MPC controller object
First MPC object to compare
mpcobj2— MPC controller object
Second MPC object to compare
yesno— Comparison result
The returned value is a logical
1 (that is
true) if the design specifications (models, weights, horizons,
etc.) are identical.