Solving a QP by minimizing multiple multidimensional vectors

3 views (last 30 days)
Hello, I would like to solve a quadratic programming problem in multiple vectors.
Does anyone know a function like quadprog that allows me to solve this? Thank you in advance.

Accepted Answer

Matt J
Matt J on 18 Nov 2021
Edited: Matt J on 18 Nov 2021
If you have multiple unknown vectors x1, x2, x3,... then you also have a single unknown vector X=[x1;x2;x3;...]. So, just use quadprog() as usual with X as your unknown.
You can also use the problem-based workflow to translate the problem into proper quadprog input, e.g.,
x=optimvar('x',3,'Lower',0);
y=optimvar('y',4,'Upper',1);
Qx=rand(3); Qy=rand(4);
prob=optimproblem('Objective',x'*Qx*x + y'*Qy*y);
sol=solve(prob)
Solving problem using quadprog. Your Hessian is not symmetric. Resetting H=(H+H')/2. The problem is non-convex.
sol = struct with fields:
x: [3×1 double] y: [4×1 double]

More Answers (0)

Categories

Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!