I have some measurements in Matlab that I wanna use to fit a exponential curve. To this measurements I have different uncertainty. How do I fit a exponential curve with this uncertainty balanced?
Asked
Active
Viewed 2,067 times
1 Answers
1
Let´s generate exponential data, “with different uncertainty”:
x=0:0.1:5;
k=randn(1,length(x))*4;
Measurement_data=exp(x)+k;
Fit data to a single exponential, where f
is the fitting model:
f = fit(x',Measurement_data','exp1')
Plot measurement data and fitting curve:
plot(x,Measurement_data,'.');
hold on
plot(x,f.a*exp(f.b*x));
In this case, fitting model f
is:
General model Exp1:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.8414 (0.6367, 1.046)
b = 1.034 (0.9805, 1.087)
Hope this solves your problem.

hello123
- 313
- 1
- 7