setting a vector sum as a lower and upper bound in fmincon
2 ビュー (過去 30 日間)
古いコメントを表示
I would like to set a constraint for the optimization problem to be solved by fmincon so that the vector, x, of solution values has values that sum between two scalar values. Is there a way to do this?
0 件のコメント
回答 (1 件)
Titus Edelhofer
2011 年 7 月 21 日
Hi,
yes there is: add to the matrix "A" (inequalities) two lines
A = [ones(1, length(x)); -ones(1, length(x))];
and for the right hand side take the upper and lower bound
b = [upperBound; -lowerBound];
Titus
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Nonlinear Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!