i get good fitting result from curve fitting toolbox, how can i convert it to program code?
Show older comments
Hello,
I used cftool to get good fitting result. I wonder how can i convert it to program.
The option i used (in fact, is default setting):
Type of fit:Customer equation
Fit options:NonlinearLeastSquares
Robust: off
Algorithm: Trust-region
After solving, I can get: General model: f(x) = a^2/((b^2+(x-c)^2)) Coefficients (with 95% confidence bounds): a = 8.821 (-5.137, 22.78) b = 2.988 (0.1299, 5.846) c = 18.64 (17.21, 20.07)
The value of a,b,c is exactly what I want. But I want to use code to get the above solution.
I think it is related to fsolve, but i spend hours of time, but still I cannot figure out how to use code to get my result.
Thanks for help!
Answers (1)
Andrei Bobrov
on 23 Mar 2012
0 votes
try use nlinfit from Statistics Toolbox
Categories
Find more on Interpolation 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!