필터 지우기
필터 지우기

Curve fitting with a known coefficient

조회 수: 12 (최근 30일)
Mahesha MG
Mahesha MG 2013년 7월 4일
댓글: Valentin Fazenda 2020년 3월 9일
I want to fit set of data points (x,y) to the equation 'g*x+a*(x/248.7860)^3*c'. Here g and a are unknown coefficients and x is independent variable. c is coefficient which is an array of size same as x (c varies with x but it is not weight) c is known. How to do the fitting? I tried the following: ft = fittype( 'g*x+a*(x/248.7860)^3*c', 'independent', 'x','independent', 'c', 'dependent', 'y' ); But it is not working. Any other way to solve?
  댓글 수: 1
Valentin Fazenda
Valentin Fazenda 2020년 3월 9일
I have the same problem but with a complex equation :
PA=fittype('(Fz*(b1*Fz+b2))*sind(b0*atand((((b3*(Fz^2)+b4*Fz)*exp(-b5*Fz))/(b0*(Fz*(b1*Fz+b2))))*(x+(b9*Fz+b10))-((b6*Fz^2+b7*Fz+b8)*(1-b13*sind(x+(b9*Fz+b10))))*((((b3*(Fz^2)+b4*Fz)*exp(-b5*Fz))/(b0*(Fz*(b1*Fz+b2))))*(x+(b9*Fz+b10))-atand((((b3*(Fz^2)+b4*Fz)*exp(-b5*Fz))/(b0*(Fz*(b1*Fz+b2))))*(x+(b9*Fz+b10))))))+(b11*Fz+b12)','problem', 'Fz');
where Fz is known and is an (known) array of size same as x and i dont' know how write it so that Fz will not anymore be calaculated but used by the computer

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

답변 (2개)

David Sanchez
David Sanchez 2013년 7월 4일
You can use the curve fitting tool. Type:
cftool
at the command window. Then, select " custom equation " as your target and type your equation on the right box.
  댓글 수: 1
Mahesha MG
Mahesha MG 2013년 7월 4일
편집: Mahesha MG 2013년 7월 4일
I tried this. But it takes c as unknown coefficient and gives some value for it.

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


Matt J
Matt J 2013년 7월 4일
편집: Matt J 2013년 7월 4일
Functions from the Curve Fitting Toolbox seem like overkill here, considering that you have a very simple, linear fitting to do:
A=[x(:), (x(:)/248.7860).^3.*c(:)];
p=A\y(:);
g=p(1);
a=p(2);

카테고리

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