When plotting the symbolic version on the curve fit polynomial they do not match.
1 view (last 30 days)
Show older comments

I just added a picture so both the code and the results from the curve fitting can be seen.
I copy the coefficients and the equation from the curve fitting toolbox, however, when I plot it using fplot it doesnt match. After messing around a bit it seems like the curve has been squished down to [0,1/2]
I also tried using polyval, which agrees with the symbolic version.
Should add that the x vector is 5000 evenly spaced floats from 0 - 1 while y is experimental data which looks like the one in the curve fitting window.
0 Comments
Accepted Answer
Steven Lord
on 2 Nov 2021
Don't copy the coefficients. You're not copying them to their full precision. Instead export the fit from the app (or generate code if you want to automate this process for multiple data sets) and then evaluate the fit.
If you actually need the coefficient values use the coeffvalues function on the exported fit.
0 Comments
More Answers (0)
See Also
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!