I want to solve a simple convex problem that minimizes the power of transmitting devices. I have a supposed that there are 10 devices each communicating with another device. But, when I run the program it gives me this error,

The following error occurred converting from cvx to double:

Conversion to double from cvx is not possible.

Error in testcode4 (line 12)

Rate(i,j) = log(1+(p(i)*((distance(i,j)).^(-pathloss))));

```
distance = rand(10,10);
Rate_min = ones(10,10);
Power_total = 10;
Rate = zeros(10,10);
cvx_begin
variable p(10,1) nonnegative
minimize norm(p)
subject to
for i = 1:10
for j = 1:10
Rate(i,j) = log(1+(p(i)*((distance(i,j)).^(-pathloss))));
end
end
Rate >= Rate_min;
sum(p) <= Power_total;
cvx_end
```