Fitting to an exponential function from row datas
1 次查看(过去 30 天)
显示 更早的评论
I have a function y dependent on t. I want to fit it to a function of y=a*exp(-b/t) and determine the variables "a" and "b". I write the code below, however, it didn't converge. Any help is appreciated.
Thanks GH
clear all
clc
Data=[300.0092 2.2742e-16
331.0053 2.1617e-15
335.0210 3.0675e-15
361.2484 4.3307e-14];
t = Data(:,1);
y = Data(:,2);
plot(t,y,'ro')
title('Data points')
F = @(x,xdata)x(1)*exp(-x(2)*xdata);
x0 = [10^-16 0.001];
[x,resnorm,~,exitflag,output] = lsqcurvefit(F,x0,t,y)
hold on
plot(t,F(x,t))
hold off
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!