How to implement an optimized variable with a value of 0 or 1 using CVX


(hataimengzhu) #1

cvx_begin
cvx_quiet(true);
variable C(10)
minimize sum©
subject to
for i=1:10
C(i)==0||C(i)==1;
end
cvx_end


(Mark L. Stone) #2

http://cvxr.com/cvx/doc/basics.html#variables

variable C(10) binary