Hi everyone,

I am new to using cvx expressions and would like to know if what I have implemented is correct. I wish to express the following summation:

My code:

J = 5; C = randi([100 8e2],5,1);

amax = max(floor(log2©));

variable G(5,amax+1) binary;

expression ib4(5);

for j = 1:J

temp1(j) = floor(log2(C(j)));

for a = 1:temp1(j)+1

ib4(j) = ib4(j) + 2^(a-1) * G(j,a);

end

end

Thanks!