MATLAB: Does the FMINCON function from the Optimization Toolbox sometimes get stuck in an infinite loop

fminconinfiniteloopOptimization Toolbox

The FMINCON function from the Optimization Toolbox sometimes gets stuck in an infinite loop.

Best Answer

This is a bug in Optimization Toolbox 2.2 (R13) in the way that FMINCON handles the default infinite-valued "MaxSQPiter" property in the options structure.
To work around this issue, try the following:
Make sure to set the "MaxSQPIter" property in the OPTIMSET function to a finite value. Ideally, it should be a multiple of the larger of the number of variables or number of constraints.