MATLAB: In fmincon function, how can I impose non-strict constraints

fmincon

In fmincon, I know MATLAB can set constraints like a+b<=1 and a<=1, but what about a+b<1 and a<1?

Best Answer

There is a tolerance called TolCon that gives the wiggle room for constraint violation. So, if you have options such as
options = optimoptions('fmincon');
then, similar to Walter's suggestion, you can try to enforce
a + b <= 1 - options.TolCon; % in a linear inequality constraint
a <= 1 - options.TolCon; % in a bound
Alan Weiss
MATLAB mathematical toolbox documentation
Related Question