# How to find nuclear norm in CVX？

here is my code.

cvx_solver mosek
cvx_begin
variable V(3,3)

``````f1=log(2).*(trace(H_ak1*V)*ap1+wk(1,1)*ap1+noise);
f2=log(2).*(trace(H_ak2*V)*ap2+wk(1,2)*ap2+noise);
f3=log(2).*(trace(H_ak3*V)*ap3+wk(1,2)*ap3+noise);
ge1=log(2).*(trace(H_ae*V)*(ap1-p_k0(1,1))+we*(ap1-p_k0(1,1))+noise);
ge2=log(2).*(trace(H_ae*V)*(ap2-p_k0(1,2))+we*(ap2-p_k0(1,2))+noise);
ge3=log(2).*(trace(H_ae*V)*(ap3-p_k0(1,3))+we*(ap3-p_k0(1,3))+noise);

der_g1=((ap1-p_k0(1,1))*H_ak1'*log2(exp(1)))/(trace(H_ak1*V0)*(ap1-p_k0(1,1))+wk(1,1)*(ap1-p_k0(1,1))+noise);
der_g2=((ap2-p_k0(1,2))*H_ak2'*log2(exp(1)))/(trace(H_ak2*V0)*(ap2-p_k0(1,2))+wk(1,2)*(ap2-p_k0(1,2))+noise);
der_g3=((ap3-p_k0(1,3))*H_ak3'*log2(exp(1)))/(trace(H_ak3*V0)*(ap3-p_k0(1,3))+wk(1,3)*(ap3-p_k0(1,3))+noise);
g1_ub=log(2).*(trace(H_ak1*V0)*(ap1-p_k0(1,1))+wk(1,1)*(ap1-p_k0(1,1))+noise)+trace(der_g1'*(V-V0));
g2_ub=log(2).*(trace(H_ak2*V0)*(ap2-p_k0(1,2))+wk(1,2)*(ap2-p_k0(1,2))+noise)+trace(der_g2'*(V-V0));
g3_ub=log(2).*(trace(H_ak3*V0)*(ap3-p_k0(1,3))+wk(1,3)*(ap3-p_k0(1,3))+noise)+trace(der_g3'*(V-V0));

der_fe1=ap1*H_ae'*log2(exp(1))/(trace(H_ae*V0)*ap1+we*ap1+noise);
der_fe2=ap2*H_ae'*log2(exp(1))/(trace(H_ae*V0)*ap2+we*ap2+noise);
der_fe3=ap3*H_ae'*log2(exp(1))/(trace(H_ae*V0)*ap3+we*ap3+noise);
fe1_ub=log(2).*(trace(H_ae*V0)*ap1+we*ap1+noise)+trace(der_fe1'*(V-V0));
fe2_ub=log(2).*(trace(H_ae*V0)*ap2+we*ap2+noise)+trace(der_fe2'*(V-V0));
fe3_ub=log(2).*(trace(H_ae*V0)*ap3+we*ap3+noise)+trace(der_fe3'*(V-V0));

[evec,eval]=eig(V0);
evalues=diag(eval);
[a,b]=sort(evalues,'descend');
evectors=evec(:,b);
V0_max_vector=evectors(:,1);

V0_exp=norm(V0,2)+trace(V0_max_vector*V0_max_vector'*(V-V0));
Punish_V=sum(svd(V))-V0_exp;
e=eig(V);
result2=(g1_ub-f1-ge1+fe1_ub)+(g2_ub-f2-ge2+fe2_ub)+(g3_ub-f3-ge3+fe3_ub)+m_V*Punish_V;

minimize real(result2)

subject to
diag(V)==ones(3,1);
e>=zeros(3,1);
``````

cvx_end

Punish_V=sum(svd(V))-V0_exp;

How to find unclear norm in CVX？
Matlab said The function ‘svd’ corresponding to an input parameter of type ‘CVX’ is not defined.

Use norm_nuc(V) to replace sum(svd(V)). See if it works.

Disciplined convex programming error:
Illegal operation: {convex} - {complex affine}

z = plus( x, y, true, cheat );

Punish_V=norm_nuc(V)-V0_exp;

I solved this problem.

here is a new question.
The function ‘eig’ corresponding to an input parameter of type ‘CVX’ is not defined.

e=eig(V);

Can you help me answer this question？Thanks.

Use lambda_min(V) >= 0 to replace “e>=zeros(3,1)” in your code. More similar questions pls check this link CVX Reference guide.

Thank you very much. The problem has been solved.