Conversion to double from cvx is not possible. isequal

I have this code and N, K, and other constant have been declared previously
I get this error
Conversion to double from cvx is not possible.
please guide me
thanks

cvx_begin
    variable a(N,K) nonnegative
    gama0 = P * db2pow(row0) / sigma2;
    R = zeros (K,1) ;
    for i = 1 : K
        r = 0 ;
        for n = 1 : N
            r = r + a(n,i) * log2(1+(gama0/(H^2+norm(Q(n)-X(i))^2)));
        end
        R(i) = r / N;
    end
    eta = min (R);
    maximize eta
    subject to
        isequal(R >= eta , ones (K,1));
        isequal(sum(a,2)<= 1 , ones (N,1));
        isequal(a<=1 , ones(N,K));
cvx_end

Change R = zeros (K,1) ; to use an expression holder per

R = expression(K,1)

Note R = expression(K) is the same, so could be used instead.

1 Like

very thanks,
but I get another error:
Too many input arguments.
Trying to declare multiple expression holders? Use the EXPRESSIONS keyword instead.

R is a K*1 vector and seems that i should use expression but i get error

Please show us a complete reproducible program which triggers this error.

I suspect you have done something crazy.