MATLAB Answers

Error with lsqnonlin : Error in lsqncommon (line 14) if any(~isfin​ite(initVa​ls.F))

14 views (last 30 days)
Franck Farail
Franck Farail on 6 Apr 2021
Commented: Franck Farail on 9 Apr 2021 at 12:23
Hello everybody,
I have a question : when I run my programm, I have an error in lsqncommon. So I went in this function to understand my error and the programm stop at this line of the function lsqncommon :
if any(~isfinite(initVals.F))
error(message('optimlib:commonMsgs:UsrObjUndefAtX0', caller));
end
But I don't understand the meaning of this line, is there someone who can explain me this line please ?
Thanks !
Franck

Accepted Answer

Alan Weiss
Alan Weiss on 6 Apr 2021
Apparently, some initial values are not finite. You gave a value of x0 so that your objective function evaluated at x0 gives some NaN or Inf value. The solver cannot proceed from such a point.
Alan Weiss
MATLAB mathematical toolbox documentation

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!