How to maximize this function: x1^2+x2^2+...+xn^2 ?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello
How can I maximize the function x1^2+x2^2+...+xn^2
under some constraints which are LINEAR?
Thank you very much in advance!
Alex
댓글 수: 0
답변 (2개)
Sean de Wolski
2012년 7월 2일
fmincon
댓글 수: 1
Teja Muppirala
2012년 7월 3일
Or how about QUADPROG?
H = identity matrix
f = zero vector
A,b = your linear constraints
Richard Brown
2012년 7월 3일
편집: Richard Brown
2012년 7월 3일
I assume you mean minimise rather than maximise, because unless you have n independent constraints, your problem is unbounded.
In this case, assuming your constraints are Ax = b, just use the QR factorisation
[Q, R] = qr(A', 0);
x = Q * (R' \ b);
댓글 수: 1
Richard Brown
2012년 7월 3일
just reread your question - if your constraints are inequalities, quadprog is the way to go
참고 항목
카테고리
Help Center 및 File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!