How to constrain the results calculated by "nlinfit" from complex number to real number?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello everybody,
Recently I used the mathematic function "nlinfit" to execute the fit. Unfortunately, the results show that the fitting coefficients are complex number, which does not have a physical meaning of my model.
I know there is one way to just use the absolute value to get real number after the fitting. However, it is just a trick! So how can I constrain it to real number before starting the fitiing?
댓글 수: 2
Torsten
2017년 8월 4일
You will have to constrain the parameters E and B such that T_b-T^0 remains positive.
Best wishes
Torsten.
John D'Errico
2017년 8월 4일
편집: John D'Errico
2017년 8월 4일
Taking the absolute value does not provide a useful solution anyway, since the result is not a minimum sum of squares of errors.
As Torsten said, you need to prevent that term from going negative or zero. This is not possible to do using nlinfit of course, since nlinfit does not allow that class of constraint on the parameters.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!