フィルターのクリア

Fitting to an exponential function from row datas

3 ビュー (過去 30 日間)
friet
friet 2017 年 6 月 4 日
回答済み: Star Strider 2017 年 6 月 4 日
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

回答 (1 件)

Star Strider
Star Strider 2017 年 6 月 4 日
It appears to with:
x0 = [1E-15 -0.1];

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by