Fitting data with custom equation
조회 수: 5 (최근 30일)
이전 댓글 표시
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
2020년 11월 18일
What was the top google result when you searched for a solution? How did you try to implement it?
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!