Explanation

The CheckGradients option in optimoptions will be removed in a future release. With appropriate code changes, use the checkGradients function instead.

For additional information, see checkGradients.


Suggested Action

Update existing code to use checkGradients instead. For example:

OldNew
opts = optimoptions("fmincon",SpecifiObjectiveGradient=true,...
            CheckGradients=true);
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,opts);
tf = checkGradients(fun, x0);