How can I obtain the coefficient values, confidence intervals, and other data generated by the CFTOOL GUI within the Curve Fitting Toolbox from my saved fitted model object?

99 views (last 30 days)
If I generate a fit using the CFTOOL GUI within the Curve Fitting Toolbox, I would like to extract the values of the coefficients of the fit in the "cfit" object that is created when I use the "Save to Workspace" button and store them in an independent workspace variable.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 May 2013
This enhancement has been applied for Release 14 SP1 (R14SP1). For previous releases, read below for any possible workarounds:
To obtain the coefficient values from a "cfit" object, use the COEFFVALUES function. For example, if you saved a fitted model from the CFTOOL to a variable named "MyModel", the following command will extract the coefficient values:
MyCoeffs = coeffvalues(MyModel)
For example, the second coefficient "p2" (if it exists) can be obtained with:
coeff_2 = MyCoeffs(2)
You can also use several other functions within the Curve Fitting Toolbox to extract additional information from the "cfit" object.
CONFINT produces the confidence intervals on the coefficients.
DIFFERENTIATE differentiates the fit.
INDEPNAMES extracts the names of the independent parameters of the fit.
INTEGRATE integrates the fit.
PLOT plots the fit.
PREDINT computes confidence intervals on the predictions produced by the fit.
All these functions are used in a manner similar to COEFFVALUES. Refer to the documentation for the exact syntax for each of these functions.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!