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!