How do I constrain a vector's value within a nonlinear fit?

3 ビュー (過去 30 日間)
matlabkid602
matlabkid602 2017 年 7 月 20 日
コメント済み: matlabkid602 2017 年 7 月 20 日
I am fitting a set of data using nlinfit as magnetic dipoles and I want my fitted parameters to be only positive.
How do I make this constraint?

採用された回答

Torsten
Torsten 2017 年 7 月 20 日
Put them in the fittype equation as parameters-squared.
Best wishes
Torsten.
  3 件のコメント
Torsten
Torsten 2017 年 7 月 20 日
編集済み: Torsten 2017 年 7 月 20 日
Yes, put the parameters squared in the fittype function and square the results after solving.
Best wishes
Torsten.
matlabkid602
matlabkid602 2017 年 7 月 20 日
Thank you, it works.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by