MATLAB: How to disable informational messages displayed by some optimization functions, such as LSQNONLIN

disableoffOptimization Toolboxturnwarnings

The LSQNONLIN function displays the following message when the function terminates normally:
Optimization terminated: norm of the current step is less
than OPTIONS.TolX.

Best Answer

This message is not a warning message per se, and for that reason doesn't have a message ID which would allow it to be disabled.
Warnings can be suppressed using
''warning off all'
By default LSQNONLIN displays a message upon termination which gives information about the conditions under which the optimization finished. If you want to disable this functionality, you may use the options structure as follows:
opts1= optimset('display','off');
This options structure can then be passed into the optimization function to disable the messages at the termination of the optimization.