Fitting data with custom equation

5 ビュー (過去 30 日間)
anubha agarwal
anubha agarwal 2020 年 11 月 18 日
コメント済み: Ameer Hamza 2020 年 11 月 25 日
Hi,
I have a data set of X-axis and Y-axis. I have attched the Excel file of my data.
So i want to fit this data in a equation P(t) = At^(−(1+α))e(−t/tc).
I want to do this by curve fitting? I'd like to obtain the parameter α,tc as an answer.
please let me know how to do this.
  1 件のコメント
Rik
Rik 2020 年 11 月 18 日
What was the top google result when you searched for a solution? How did you try to implement it?

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 18 日
You can use lsqcurvefit()
data = readtable('data set.xlsx');
x = data.LOGX;
y = data.LOGY;
P = @(param, t) param(1)*t.^(-(1+param(2))).*exp(-t/param(3));
sol = lsqcurvefit(P, rand(3,1), x, y);
plot(x, y, '+', 'DisplayName', 'Actual Data')
hold on
plot(x, P(sol, x), 'DisplayName', 'Estimated')
legend()
  2 件のコメント
anubha agarwal
anubha agarwal 2020 年 11 月 25 日
I am obtaining the complex value of parameters even after changing the upper and lower bounds of the parameters.
Ameer Hamza
Ameer Hamza 2020 年 11 月 25 日
Can you show the data which gives complex parameters?

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

その他の回答 (0 件)

カテゴリ

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