MATLAB: Which values of exitflag in lsqcurvefit is denoting the result is true

exitflaglsqcurvefit

I am a geotechnique engineer ,and not family with matlab . i want to know which situation :exitflag= 1 2 3 4 0 …… is acceptable. i modify the parameters as :options = optimset('TolFun',1e-15,'MaxFunEvals',100000000000,'maxiter',4000,'tolx',1e-15),when the exitflag=0; but the output lists the items in the options above are not up to the values set above. why? thanks! wxj

Best Answer

The lsqcurvefit exit flags are described in Output Arguments in this link. As with all other Optimization Toolbox solvers, positive exit flags generally mean you got a local optimum.
It is usually not a good idea to set tolerances as small as 1e-15; see this link.
Exit messages inform you why a solver stops.
Alan Weiss
MATLAB mathematical toolbox documentation