fitting 2 variable function to (x-1) form

조회 수: 1 (최근 30일)
Benjamin
Benjamin 2019년 3월 28일
댓글: Benjamin 2019년 3월 29일
I have this fit currently which works great:
fitobject = fit([r,eta/eta_c],H,ft,'problem',knownVals)
However, because of the nature of the data, it would make more sense if r was actually in the form of .
When I change the code to this:
fitobject = fit([(r-1),eta/eta_c],H,ft,'problem',knownVals)
My fit is completey messed up, and it looks nothing like the data.
My question is, am I employing the fit correctly?
The form should look like: Cij * (r-1)^i *(eta/eta_c)^j.
I wonder if I missed something in the fitting procedure?
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 3월 28일
Possibly it would help to use 'Upper' and 'Lower' (bounds) or 'StartPoint' options.

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

채택된 답변

Catalytic
Catalytic 2019년 3월 29일
편집: Catalytic 2019년 3월 29일
My fit is completey messed up, and it looks nothing like the data.
It shouldn't look like the r and eta data, because that's not the data you fed to the fit, but it should look a lot like r-1 and eta/eta_c.
If I were you, I would just re-define all the r and eta data and forget about it instead of repeatedly having to remember to transform them everywhere they are used in the code. So, I would have
r=r-1;
eta=eta/eta_c;
fitobject = fit([r,eta],H,ft,'problem',knownVals);
plot(fitobject,[r,eta],z)
  댓글 수: 1
Benjamin
Benjamin 2019년 3월 29일
Thanks for catching that mistake!!

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

추가 답변 (0개)

카테고리

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