optimization: have function return NaN but not at initial point
조회 수: 6 (최근 30일)
이전 댓글 표시
I use fmincon interior-point algoritm to solve my optimization problem.
Based on Matlab's recommendation, I let my function return NaN if the objective function can not be evaluated for given parameters to indicate fmincon to try a different set of parameters. This works very well at intermediat iterations...
I got the following error:
"Errror using barrier. Objective function is undefined at initial point. Fmincon can not continue."
However, if I do not return NaN, fmincon, for whatever reasons, can solve the optimization problem even if the initial point is not correctly evaluated. Indeed, I observe this for many start vectors.
Anyway, is there a way to return NaN in my function always, except at the evaluation of the initial point? That is, figuring out (somehow) when my function is called with the initial point?
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!