Matlab: cvx convex programming error

545 Views Asked by At

I am new to cvx and get an error in solving the following convex problem:

enter image description here

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.

0

There are 0 best solutions below