How to constrain the results calculated by "nlinfit" from complex number to real number?
4 次查看(过去 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 中查找有关 Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!