The optim function does not report the status of the optimization.
Reported by Michael BAUDIN
Originally assigned to Michael BAUDIN
The output arguments of the optim function are:
[fopt, xopt, gopt, work]=optim(...)
but none of these arguments is the status of the optimization.
By contrast, the lsqrsolve function returns an info variable:
[xopt, ropt, info]=lsqrsolve(...)
which contains a flint representing the status of the optimization.
Here are the first few values of this variable:
* info = 0: improper input parameters.
* info = 1: algorithm estimates that the relative error between x and the solution is at most tol.
* info = 2: number of calls to fcn reached
* info = 3: tol is too small. No further improvement in the approximate solution x is possible.
This feature should be provided to the optim function as well.