When I run the following code, I can’t get the optimization result. I don’t understand why?
%code
function [R] = rankrecover(s,Mat,M)
I = eye(MM);
for i = 1:M
for j = 1:M-i+1
idx((2M-i+2)(i-1)/2+j) = (i-1)M+1+(M+1)(j-1);
end
end
Q = I(idx,:);
% cvx_solver sdpt3
cvx_begin quiet
cvx_precision low
variable R(M,M) complex semidefinite hermitian toeplitz
expressions r(MM,1)
r = R(:);
expressions q(M*(M+1)/2,1)
q = Q*r;
minimize norm_nuc( R )
subject to
norm(s-Mat*q,‘fro’) <= 1e-1;
cvx_end
number of iterations = 17
residual of dual infeasibility
certificate X = 9.75e-13
reldist to infeas. <= 1.44e-12
Total CPU time (secs) = 0.85
CPU time per iteration = 0.05
termination code = 2
DIMACS: 1.0e+01 0.0e+00 9.0e-01 0.0e+00 -1.0e+00 5.2e-03
Status: Infeasible
Optimal value (cvx_optval): +Inf
I try to use YALMIP to solve the problem, but it does not work.Why?
%code
R = sdpvar(M,M,‘full’,‘complex’);
r = sdpvar(MM,1,‘full’,‘complex’);
q = sdpvar(M(M+1)/2,1,‘full’,‘complex’);
c = [];
c = [c,R >= 0,r == R(:),R == R’,q == Qr,norm(s-Matq) <= 0.1];
f = norm(R,‘nuclear’);
result = optimize(c,f);
if result.problem == 0
R = value®;
else
disp(‘wrong’);
end
num. of constraints = 182
dim. of sdp var = 20, num. of sdp blk = 1
dim. of socp var = 29, num. of socp blk = 1
dim. of linear var = 52
dim. of free var = 130
*** convert ublk to linear blk
number of iterations = 10
residual of dual infeasibility
certificate X = 3.28e-07
reldist to infeas. <= 1.12e-09
Total CPU time (secs) = 0.15
CPU time per iteration = 0.01
termination code = 2
DIMACS: 1.9e+01 0.0e+00 6.4e-01 0.0e+00 -9.6e-01 5.3e+00