Export residuals from curve fitting
Ältere Kommentare anzeigen
Hi,
I am using the curve fitting toolbox on MATLAB_R2019a to create a (linear least square fit) by creating a (Polynomial fit with 1 degree).
I would like to export the residuals values to an array. I know I can acheive that manually from Fit >> Save to work space >> output.
But I have a loop around 1000 file so I would like to export residuals individually for each fit.
Any help is apprciated.
Akzeptierte Antwort
Weitere Antworten (1)
For a simple 1 degree polynomial, why not just use polyfit?
p=polyfit(x,y,1);
residuals=polyval(p,x)-y;
4 Kommentare
Mohammed Hammad
am 7 Jul. 2019
Matt J
am 7 Jul. 2019
Yes, if you really are just doing a 1D line fit.
Mohammed Hammad
am 7 Jul. 2019
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!