Curve fitting tool error with custom equation

7 ビュー (過去 30 日間)
Luca Fanciullini
Luca Fanciullini 2021 年 6 月 15 日
コメント済み: Luca Fanciullini 2021 年 6 月 15 日
Hi,
I'm trying to fit this equation a*exp(-b*x) + c*(1/x)+d to my data. Using the curve fitting tool I constantly get this error:
Inf computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients.
Yes, I tried to tighten the bounds on coefficients but it didn't really work.
You can find attached a .mat file with my data.
Here's a screenshot:
Thank you so much!!

採用された回答

Steven Lord
Steven Lord 2021 年 6 月 15 日
Does your data contain a point with x = 0? If so the term c*(1/x) is going to give you Inf or NaN (depending on whether or not c is 0 when you try to evaluate the fit) and the Curve Fitting Tool does not support that.
If you want to keep that form, remove data points with x = 0 from your data before trying to fit.
  1 件のコメント
Luca Fanciullini
Luca Fanciullini 2021 年 6 月 15 日
Solved, thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by