Plot - show fitting error

2 Ansichten (letzte 30 Tage)
Auryn_
Auryn_ am 5 Mär. 2019
Beantwortet: darova am 5 Mär. 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!

Antworten (1)

darova
darova am 5 Mär. 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)

Kategorien

Mehr zu Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by