Plot - show fitting error

1 vue (au cours des 30 derniers jours)
Auryn_
Auryn_ le 5 Mar 2019
Hi,
Starting with a set of data points, I use a fitfun function to fit it to a nonlinear scaling function A^x.
Now, I would like to quantify the error of the fits themselves, to understand how the points deviate from the scaling function.
May I ask for any help to do this?
Thanks!

Réponses (1)

darova
darova le 5 Mar 2019
A = 1.9;
x = linspace(0,4,50);
y = A.^x + rand(1,50);
res = fit(x',y','A.^x');
y1 = res.A.^x;
plot(x,y,'.',x,y1)
legend('data','fit')
figure
title('Error')
plot(x,y1-y)

Catégories

En savoir plus sur Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by