Dear all,

I have two constraints and I want to create a matrix that respects my constraints.

I used CVX feasibility problem and the code is attached here.

inside the constraints, I have three summations and the condition is on the last loop.

When I run the code, it gives me zero matrices, meanwhile, it should be a binary matrix.

Best Regards

N=2;C=2;T=2;

cvx_begin

variable phi_a(N,C,T) binary;

minimize 0

subject to

% first constraint

for t = 1 : T

for i = 1 : N

sum04 = 0;

for v = 1 : C

sum04 = sum04 + phi_a(i,v,t);

end

sum04 == 1

end

end

% second constraint

for t = 1 : T

for v = 1 : C

sum04 = 0;

for i = 1 : N

sum04 = sum04 + phi_a(i,v,t);

end

sum04 <= 1

end

end

A = phi_a(i,v,t);

cvx_end