How can I export the residuals from the Basic Fitting Interface Window to the MATLAB workspace?
4 views (last 30 days)
Show older comments
There is an option to send the norm of the residuals to the workspace from the second panel (click the arrow key on the first panel to get here), but not one for sending the residuals themselves.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This enhancement has been incorporated in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
As a workaround, use "Save To Workspace" on the second panel to save the fit to the workspace (say it is called fit1).
Then if the fit is one of the two spline fits, and x and y are the data vectors, use:
residuals = abs(y - ppval(fit1.coeff,x));
If the fit is one of the polynomials, use:
residuals = abs(y-polyval(fit1.coeff,x));
0 Comments
More Answers (0)
See Also
Categories
Find more on Smoothing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!