thanks a lot .here is my complete code

% initialization optimization for W0 and U0

clc;

close all

load ‘initial-w’

load ‘initial-u’

epsilon=0.0001;

L=10;

K=10;

N=1;

for k=1:K

for l=1:L

p=[zeros(1,(l-1)*N),ones(1,N),zeros(1,(L-l)*N)];

ro(l,k)=1./(trace(w(:,k).*w(:,k)’.*diag§)+epsilon);*

end

end

r_old=r;

ro_old=ro;

u_old=u;

w_old=w;

for itr=1:1000

cvx_begin

variable w(L,K)

variable u(L,K)

% %

H=0;

for k=1:K

I=0;

for i=1:K

I=h(:,k)’. w(:,i).*w(:,i)’.*h(:,k)+I;

end

H=H+ log2(sigma.^2+I);

end

% %

f2=0;

for l=1:L

for k=1:K

p=[zeros(1,(l-1)*N),ones(1,N),zeros(1,(L-l)*N)];

f2= f2+ ro_old(l,k)*trace(w(:,k).*w(:,k)’.* diag§)*r_old(k);

```
end
```

f3(l)=f2;

end

f4=0;

for l=1:L

for k=1:K

p=[zeros(1,(l-1)*N),ones(1,N),zeros(1,(L-l)*N)];

f4= f4+ ro_old(l,k)*trace(w(:,k).*w(:,k)’.* diag§);

```
end
```

f5(l)=f4;

end

for l=1:L

x2=cvx(0);

y2=cvx(0);

for ll=1:L

if ll~=l

x2=z+G(l,:).*u(:,l).*u(:,l)’.*G(l,:)’+x2;

y2=z+G(l,:).*u(:,l).*u(:,l)’.*G(l,:)’+y2;

end

end

phi(l)=-DC2(x2,y2);

end

for l=1:L

```
r2=0;
for j=1:L
r2=r2+G(l,:).*u(:,l).*u(:,l)'.*G(l,:)';
end
f(l)=f3(l)-log2(det(z+r2)) ;
```

end

% %

for k=1:K

s1=0;

s2=0;

for i=1:K

if i~=k

s1=s1+ h(:,k).*w(:,k).*w(:,k)’*h(:,k)’;

s2=s2+ h(:,k)*w_old(:,k).*w_old(:,k)’.*h(:,:,k)’;

end

end

g(k)=DC1(sigma^2+s1,sigma^2+s2);

end

max sum(h)-sum(g)

subject to

for l=1:L

f(l)+phi(l)<=0;

end

sum(f5)<=1

cvx_end

r_old=r;

ro_old=ro;

u_old=u;

end

now could you please tell me where is wrong?