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)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!