필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Alex
Alex 2012년 7월 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일
fmincon
  댓글 수: 1
Teja Muppirala
Teja Muppirala 2012년 7월 3일
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일
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
Richard Brown 2012년 7월 3일
just reread your question - if your constraints are inequalities, quadprog is the way to go

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

카테고리

Help CenterFile 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!

Translated by