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!