I want to solve the following LP using Mosek (called from Matlab)
max wrto b A'b where -1<=b<=1
A,b have length L.
This is how I implement this.
clear
rng default
L=5;
A= 1.0e-03 *[0;0;0.8217;0;0]';
prob.blx=-ones(L,1); %lower bound unknowns
prob.ulx=ones(L,1); %upper bound unknowns
prob.c=A; %objective function
param_MOSEK.MSK_IPAR_LOG = 0;
[~,res] = mosekopt('maximize echo(0)',prob, param_MOSEK);
I get this error: Error(1200): prob.a not specified
How can I fix it?
prob.a is obligatory, even if it has 0 rows. In your case sparse(0,L)
should be fine. See the last example in https://docs.mosek.com/9.2/toolbox/design.html#hello-world-in-mosek