curve fit exactly the function I enter
Show older comments
I have some data points and a known function with 4 parameters. But when I tried to use the 'cftool', part of the data points aren't fitting the curve. The function is 2 exponential terms but I enter it as customized function.
3 Comments
John D'Errico
on 11 Jun 2018
Edited: John D'Errico
on 11 Jun 2018
Just because you picked a function does not mean that it can be used to fit any set of points.
Perhaps you are trying to imply that the points are generated by evaluating them form a known function, and you are tying to test fit the function, to see if the curve fit "works"?
What you need to understand is that you need to supply adequate starting values, that sums of exponentials are difficult things to fit, and that no optimization is guaranteed to converge to the solution that you want to see.
So, if it failed to converge to the solution you wanted, then provide adequate starting values.
JuiChun Lin
on 11 Jun 2018
Walter Roberson
on 11 Jun 2018
Your data probably doesn't match the model very well. That happens a lot.
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!