Curve fitting with a custom equation
조회 수: 55 (최근 30일)
이전 댓글 표시
Hi all,
I'm trying to fit a custom equation but it seems I wrote not in the correct way or somethinkg similar (I'm quite new to Matlab)...
The equation is
u+(f-u)/(1+exp((-H/1.9872)*(1/x-1/m)+(C/1.9872)*[((m/x)-1)+log(x/m)]))
and the error message claims
Fit Name: untitled fit 1
Error: Expression u+(f-u)/(1+exp((-H/1.9872)*(1/x-1/m)+(C/1.9872)*[((m/.x)-1)+log(x/m)])) is not a valid MATLAB expression, has non-scalar coefficients, or cannot be evaluated:
Error in fittype expression ==> u+(f-u)./(1+exp((-H./1.9872).*(1./x-1./m)+(C./1.9872).*[((m./.x)-1)+log(x./m)]))
??? Invalid use of operator.
Do you have suggestions?
Thanks
Marco
댓글 수: 0
답변 (2개)
Torsten
2025년 10월 10일 17:03
Only round brackets are allowed in your expression. But maybe there are additional problems.
If the code does not work after replacing [ ] by ( ), you should post your MATLAB code for inspection.
댓글 수: 6
Torsten
2025년 10월 10일 22:30
In your fittype expression, there is another error:
m/.x
should be replaced by
m./x
or at least
m/x
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!