Curve Fitting Toolbox | ![]() ![]() |
Saving the Fit Results
By clicking the Save to workspace button, you can save the selected fit and the associated fit results to the MATLAB workspace. The fit is saved as a MATLAB object and the associated fit results are saved as structures. This example saves all the fit results for the best fit, poly2
.
fittedmodel1
is saved as a Curve Fitting Toolbox cfit
object.
whos fittedmodel1 Name Size Bytes Class fittedmodel1 1x1 6178 cfit object Grand total is 386 elements using 6178 bytes
The cfit
object display includes the model, the fitted coefficients, and the confidence bounds for the fitted coefficients.
fittedmodel1 fittedmodel1 = Linear model Poly2: fittedmodel1(x) = p1*x^2 + p2*x + p3 Coefficients (with 95% confidence bounds): p1 = 0.006541 (0.006124, 0.006958) p2 = -23.51 (-25.09, -21.93) p3 = 2.113e+004 (1.964e+004, 2.262e+004)
The goodness1
structure contains goodness of fit results.
The output1
structure contains additional information associated with the fit.
output1 output1 = numobs: 21 numparam: 3 residuals: [21x1 double] Jacobian: [21x3 double] exitflag: 1 algorithm: 'QR factorization and solve'
![]() | Determining the Best Fit | Analyzing the Fit | ![]() |