%%original code
CovN = zeros(9,9);
CovN(1,1) = 0.748067442391157;
CovN(2,2) = 0.296191639278090;
CovN(3,3) = 0.235663142131686;
CovN(4,4) = 0.523694938310680;
CovN(5,5) = 0.266981796930194;
CovN(6,6) = 0.440100596372757;
CovN(7,7) = 0.696413444063667;
CovN(8,8) = 0.602140503850647;
CovN(9,9) = 0.608831814874117;
N = zeros(9:1);
N = [1.329008068436854e8;
1.316131938310147e8;
1.339539975072583e8;
1.371060084283822e8;
1.367219474606583e8;
1.327129424622881e8;
1.360145277037465e8;
1.318220024932382e8;
1.317625271844776e8;];
optimalN = zeros(9,1);
cvx_begin
variable optimalN integer
minimize(matrix_frac((optimalN-N),CovN));
subject to
(N-35) <= optimalN <= (N+5)
cvx_end
%% the end
But when I use the Gurobi_2 in cvx, it reports the errors as:
cvx_solver Gurobi_2
testgurobi9
Calling Gurobi 7.01: 74 variables, 72 equality constraints
Status: Error
Optimal value (cvx_optval): NaN
Error using cvx_end (line 267)
Gurobi does not support semidefinite cones larger than 2x2.
You must use another solver for this problem.
Error in testgurobi9 (line 30)
cvx_end
%%the end
but I have ust the code below and validate that the CovN is definite. Why does the gurobi always say the matric is semidefinite.
%%eig
eigenvalue
CovN = zeros(9,9);
CovN(1,1) = 0.748067442391157;
CovN(2,2) = 0.296191639278090;
CovN(3,3) = 0.235663142131686;
CovN(4,4) = 0.523694938310680;
CovN(5,5) = 0.266981796930194;
CovN(6,6) = 0.440100596372757;
CovN(7,7) = 0.696413444063667;
CovN(8,8) = 0.602140503850647;
CovN(9,9) = 0.608831814874117;
[V,D] = eig(CovN)