How to access parameter guesses made by MATLAB in lsqnonlin?

조회 수: 1 (최근 30일)
Sidharth MOKTAN
Sidharth MOKTAN 2021년 4월 5일
편집: Matt J 2021년 4월 5일
Suppose I have defined some non-linear function f(x) where x is a vector of parameters. I then use lsqnonlin to solve for the x that minimizes this function.
options = optimoptions('lsqnonlin','Display','iter');
sol=lsqnonlin(f,x0,options);
How can I get a hold of all of the values of x that lsqnonlin checked when finding the minimum? I imagine that at some level lsqnonlin is conducting a grid search over various combinations of the parameter values. I would like the values of all of the grid points used in the search. sol only gives me the final answer.

채택된 답변

Matt J
Matt J 2021년 4월 5일
편집: Matt J 2021년 4월 5일
No, it is gradient-driven search, not a grid search. However, nearly all Optimization Toolbox solvers have an OutputFcn option, which can be used to acces the search points as in this example,

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by