How to maximize this function: x1^2+x2^2+...+xn^2 ?
5 次查看(过去 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!