exponential curve fitting with custom equation

3 ビュー (過去 30 日間)
AliHg
AliHg 2020 年 4 月 19 日
編集済み: Ameer Hamza 2020 年 4 月 19 日
Hello.
I need to fit the following function to a set of data.
mymodel=@(a,x) (0.1744+0.1556*exp(-x/a));
xData=[ 1.0000
1.4142
2.2361
3.1623
4.1231
5.0990
6.0828
7.0711
8.0623
9.0554
10.0499
11.0454
12.0416
13.0384
14.0357
15.0333
16.0312
17.0294
18.0278
19.0263
20.0250
21.0238
22.0227
23.0217
24.0208];
yData=[ 0.3300
0.1896
0.1448
0.1216
0.1108
0.1128
0.1168
0.1064
0.1016
0.1040
0.1072
0.1012
0.1072
0.1068
0.1048
0.1084
0.1084
0.1104
0.1152
0.1112
0.1168
0.1164
0.1252
0.1136
0.1124];
ft=fit(xData,yData,mymodel)
figure(1)
plot(ft,xData,yData)
but I get poor fitting like this:
what is the problem?
Thank you in advance

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 19 日
編集済み: Ameer Hamza 2020 年 4 月 19 日
Your model does not provide enough degree of freedom to fit all the points. Change the model to
mymodel=@(a,b,c,x) (b+c*exp(-x/a));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by