MATLAB: How to suppress messages from function lsqcurvefit

local minimum foundlsqcurvefitMATLABmessagesoptimization

I am using lsqcurvefit inside large nested for loops. The following messages are printed in the command window thousands or sometimes millions of times.
Local minimum found. Optimization completed because the size of the gradient is less thanthe default value of the function tolerance.
stopping criteria details>
The question is how can I suppress these messages?

Best Answer

  • Have you tried setting the 'Display' option?
    opts = optimset('Display','off');
    ... = lsqcurvefit(...,opts);