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!