Does the curvefit toolbox return the equation for the best fit line (or curve)?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Todd
el 14 de Mayo de 2024
For example, let's say that a 5th order polynomial fits the data nicely. Does the curvefit results include the equation, or at least the coefficients, of the 5th order polynomial fit?
Perhaps a silly question, but you might be surprized at how many so-called curve fitting programs are out there that only care about displaying the fit.
Thank you for considering my question.
Todd
1 comentario
Respuesta aceptada
the cyclist
el 14 de Mayo de 2024
3 comentarios
Steven Lord
el 14 de Mayo de 2024
And if you export the fit from the app using the last button on the toolstrip, you'll get a cfit or sfit object. You can use a number of different functions to post-process them.
load census
format longg
f = fit(cdate, pop, 'poly2')
formula(f)
coeffnames(f)
coeffvalues(f)
Note that not all types of fit give formulas you can use to evaluate the fit.
f2 = fit(cdate, pop, 'spline')
formula(f2)
But then again you don't need to use the formula to evaluate it if you have the object.
populationFromQuadratic = f(1849)
populationFromSpline = f2(1849)
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!