How to maximize this function: x1^2+x2^2+...+xn^2 ?

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

답변 (2개)

Sean de Wolski
Sean de Wolski 2012년 7월 2일

1 개 추천

fmincon

댓글 수: 1

Or how about QUADPROG?
H = identity matrix
f = zero vector
A,b = your linear constraints

댓글을 달려면 로그인하십시오.

Richard Brown
Richard Brown 2012년 7월 3일
편집: Richard Brown 2012년 7월 3일

0 개 추천

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

just reread your question - if your constraints are inequalities, quadprog is the way to go

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

태그

질문:

2012년 7월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by