Terminal weights and constraints
setterminal(MPCobj,Y,U)
setterminal(MPCobj,Y,U,Pt)
setterminal(
specifies diagonal quadratic penalty weights and constraints at the last step in the
prediction horizon. The weights and constraints are on the terminal output
y(t+p) and terminal input
u(t+p – 1), where
p is the prediction horizon of the MPC controller
MPCobj
,Y
,U
)MPCobj
.
setterminal(
specifies diagonal quadratic penalty weights and constraints from step
Pt to the horizon end. By default, Pt is the
last step in the horizon.MPCobj
,Y
,U
,Pt
)

MPC controller, specified as an MPC controller object 

Terminal weights and constraints for the output variables, specified as a structure with the following fields:
n_{y} is the number of controlled outputs of the MPC controller. If the Offdiagonal weights are zero (as described in Standard Cost Function). To apply nonzero offdiagonal terminal weights, you must augment the plant model. See Provide LQR Performance Using Terminal Penalty Weights. By default, Choose the 

Terminal weights and constraints for the manipulated variables, specified as a structure with the following fields:
n_{u} is the number of manipulated variables of the MPC controller. If the Offdiagonal weights are zero (as described in Standard Cost Function). To apply nonzero offdiagonal terminal weights, you must augment the plant model. See Provide LQR Performance Using Terminal Penalty Weights. By default, Choose the ECR magnitudes carefully, accounting for the importance of each constraint and the numerical magnitude of a typical violation. 

Step in the prediction horizon, specified as an integer between 1 and
p, where p is the prediction
horizon. The terminal values are applied to Default: Prediction horizon p 
Advanced users can impose terminal polyhedral state constraints:
K_{1} ≤ Hx ≤ K_{2}.
First, augment the plant model with additional artificial (unmeasured) outputs, y = Hx. Then specify bounds K_{1} and K_{2} on these y outputs.
mpc
 mpcprops
 setconstraint