retrieve start point in Matlab fit object
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
When using the built-in equations of the fit function, Matlab calculates the best start point.
My question is, how do I retrieve this start point from the outputs of fit?
The documentation sends me to check the function fitoptions but then that is to enter a custom start point, and that's not what I want.
Thanks!
댓글 수: 0
채택된 답변
John D'Errico
2016년 12월 25일
The starting point used is not one of the outputs of fit. I presume (for good reasons) the authors of the code never thought about this as a useful piece of information. Admittedly, as a perfectionist in my own code, it is something I might have returned were I the author, but then I'm not the author.
Of course, nothing stops you from saving the first set of values that were passed into your objective function. That would require a bit of code on your part. For example, you could create a persistent or global variable to identify the first time your function is called. Then store the set of parameters passed in that first time. Lots of ways (at least 3 that I can think of immediately) to do so. For example, you could use a write to a file, you could learn to use assignin, or you could use a global variable. These are all hacks of course, but they would work.
IMHO, it all seems a bit of a waste of time to me. If you don't like the arbitrary start point, then the options give you the ability to pass in your own start.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!