Why do I get Cannot fit Power functions to data where X has nonpositive values when using the curve fitting tool?
조회 수: 25 (최근 30일)
이전 댓글 표시
Dear community,
Maybe my question is obvious, but I am trying to estimate a curve with negative values for x using the "power1" type curve fitting tool. However, Matlab shows me the following error: "Cannot fit Power functions to data where X has nonpositive values".
My question is, is there a way to get rid of this error, or by mathematical construction is it impossible?
I attach my x and y values.
Thank you in advance!
댓글 수: 10
Torsten
2022년 1월 27일
편집: Torsten
2022년 1월 27일
I'm not aware that a power function tends to 0 as x approaches -Inf and at the same time tends to +Inf as x approaches +Inf. So the last thing I would choose as fitting function is the power function.
I'm not sure what you mean by" function transformation". Could you clarify ?
채택된 답변
Matt J
2022년 1월 27일
Torsten's idea for an exp1 fit works pretty well.
load myfile
f=fit(x,y,'exp1');
plot(f,x,y)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!