Curve fitting with custom equation, not using toolbox

조회 수: 5 (최근 30일)
JF
JF 2020년 11월 26일
댓글: JF 2020년 11월 26일
I have sample X and Y data:
x=[5:5:50];
y=[15 25 32 33 37 35 38 39 41 42];
The data are related by y = a * ( x/(b+x) ) equation
I need to find the coeffs a and b, by curve fitting.
I am trying to use polyfit, but nothing is coming out correctly.
What is the procedure for curve fitting a custom equation? The matalb book I am using is good about basic polynomial equations, and the conversion when converting other equations to polynomials. I am super lost on this one. Thanks.
The answer using Curve fitting toolbox is pasted below, but I can't seem to get there... Help!
General model:
f(x) = (a.*x)/(b+x)
Coefficients (with 95% confidence bounds):
a = 49.58 (45.65, 53.51)
b = 9.943 (7.168, 12.72)

답변 (1개)

Stephan
Stephan 2020년 11월 26일
편집: Stephan 2020년 11월 26일
This example shows how to curve fit with the inbuilt basic function fminsearch , so that no additional toolbox is needed:
  댓글 수: 1
JF
JF 2020년 11월 26일
Thanks, is there any way not using fminsearch? Our book has not covered the fminsearch function, and supposedly this can be solved just using basic commands and polyfit.
The book states: "The curve fitting can be done by writing the reciprocal of the equation and using a first order polynomial." I hope this helps in solving this problem.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile 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!

Translated by