I am trying to simulate the following convex problem:

Basically, trying to minimize the power of two users in UL transmission which are assigned to the same subcarrier of a BS. Therefore, interference is also included for the calculation of the rate.

However, only the interference of the weak user h_w < h_s is included, assuming the strong user can apply a Successive interference cancellation (SIC) technique.

I have formulated the following code, but I must have done something wrong because I get the following error message: Cannot perform the operation: {real affine} ./ {real affine}

Can I get some feedback please, so I can figure out what I am doing wrong?`Preformatted text`

```
K= 2;
R_min = 10^-2;
Power_total = 10;
h = complex(randn(2,1),randn(2,1))/sqrt(2); %CSI
cvx_begin
variable p(2) nonnegative
minimize sum(p)
subject to
expression Interference(1,2);
for i=1:K
Interference(i) = 0;
for j=1:K
if (i ~= j) && (abs(h(i)) > abs(h(j)))
Interference(i) = Interference(i) + p(j)*norm(h(j))^2;
end
end
end
% Minimum rate
log(1+p(1)*norm(h(1))^2/(1+Interference(1))) >= R_min
log(1+p(2)*norm(h(2))^2/(1+Interference(2))) >= R_min
% MAC contraints
log(1+p(1)*norm(h(1))^2/(1+Interference(1))) <= log(1+p(1)*norm(h(1))^2)
log(1+p(2)*norm(h(2))^2/(1+Interference(2))) <= log(1+p(2)*norm(h(2))^2)
log(1+p(1)*norm(h(1))^2/(1+Interference(1)))+log(1+p(2)*norm(h(2))^2/(1+Interference(2))) <= log(1+p(1)*norm(h(1))^2 + p(2)*norm(h(2))^2)
sum(p) <= Power_total
p >= 0
cvx_end
```