How to debug lineSearch, or fminusub?
6 次查看(过去 30 天)
显示 更早的评论
Hi there,
I'm trying to run multiple solvers and their algorithms to solve for 2-6 parameters. This is working fine for almost all initial points, solvers and algorithms that I use. However, for some reason the fminunc solver runs into a NaN or Inf during some iteration with one specific inital point. The NaN/Inf occurs in the roots function, which is called by lineSearch, which is in turn called by fminusub, again called by fminunc. I would like to set a break point in the lineSearch function and find out what is happening here, however I can't seem to find the lineSearch function.
This is my error:
Error using roots (line 27)
Input to ROOTS must not contain NaN or Inf.
Error in lineSearch
Error in lineSearch
Error in lineSearch
Error in lineSearch
Error in fminusub (line 186)
lineSearch(funfcn,x,dir,f,dirDerivative, ...
Error in fminunc (line 472)
[x,FVAL,GRAD,HESSIAN,EXITFLAG,OUTPUT] = fminusub(funfcn,x, ...
Typing:
help lineSearch
% or
open lineSearch
returns:
Error using open (line 86)
File 'linesearch' not found.
% or
lineSearch not found.
lineSearch is called on line 186 in fminusub.m but it seems I can't open it. I can put break points inside root.m but all I see here is nondescript numbers and the offending Inf. I don't know at which point root is called with an Inf and why. Do you have any ideas on how to debug this?
Thank you.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!