I am new to cvx and get an error in solving the following convex problem:
In the above formulation, L=|E|, 'p' and 'm' are given positive real indices. Here is my code:
cvx_begin
variable x(L,L);
maximize(sum(sum(m(1:L,1:L).*(1-x(1:L,1:L))+(p(1:L,1:L).*x(1:L,1:L)))))
subject to
for j=1:L
x(j,j)==1;
sum(x(j,:))<=C;
end
for i=1:L
for j=1:L
0<=x(i,j)<=1;
end
end
cvx_end
I guess there is something wrong with the first part of the code (objective function) which makes the following disciplined convex programming error:
Error using + (line 29)
Disciplined convex programming error:
Invalid operations:
{invalid} + {0}
{0} + {invalid}
However, I do not know how to fix it.