Ok. Thank you. But when I add the code like: F=F+[pos(1)+pos(2)==1, pos(3)+pos(4)==1, pos(5)+pos(6)==1, pos(7)+pos(8)==1, pos(9)+pos(10)==1];
F=F+[pos(11)+pos(12)==1, pos(13)+pos(14)==1, pos(15)+pos(16)==1, pos(17)+pos(18)==1, pos(19)+pos(20)==1];
F=F+[pos(21)+pos(22)==1, pos(23)+pos(24)==1, pos(25)+pos(26)==1, pos(27)+pos(28)==1, pos(29)+pos(30)==1];
F=F+[pos(31)+pos(32)==1, pos(33)+pos(34)==1, pos(35)+pos(36)==1, pos(37)+pos(38)==1, pos(39)+pos(40)==1];
MATLAB will say it is unbounded. I want to use this code to tell yalmip that nearby two positions can only choose one.