Is there an option in lsqcurvefit function in matlab to set different limits to each of the best fit coefficients ?
6 ビュー (過去 30 日間)
古いコメントを表示
Hi
I have used to lsqcurvefit to find the best fit 3 coefficients of a function. I need to set different limit to each of the 3 coefficients. Is there any provision for it? I find that you can set one limit to all the 3 coefficients but not individually. Please help me incase it is possible.
Thanks Nadia
0 件のコメント
採用された回答
John D'Errico
2016 年 5 月 27 日
Of course you can set "bounds" on the variables. But no, you are wrong that they must all be the same value. If x is the unknown vector, say of length 2 in this case, say we wanted the lower bound on x(1) to be zero, and x(2) will be unbounded from below. Then the lb argument in this case would be:
lb = [0,-inf];
Similarly, suppose we had upper bounds on x of 10 for x(1), and 5 for x(2).
ub = [10,5];
You can set the bounds to be any values you like of course. They need not all be the same. As you can see, if a variable has no lower or upper bound, then use -inf or +inf respectively.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!