retrieve start point in Matlab fit object
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
AC
am 25 Dez. 2016
Beantwortet: John D'Errico
am 25 Dez. 2016
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 Kommentare
Akzeptierte Antwort
John D'Errico
am 25 Dez. 2016
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!