1. SET is obsolete
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Commands.Set2. Strict inequalities should be avoided
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Blog.Prepare-your-codeSo I would simply write
constraints = [1 <= B <= 200, S >= 0, sum(S) == 6000000];
3.
You have not solved the problem. Look at the display. It clearly
indicates problems, the upper bound is infinite, meaning no feasible
solution was found. The solver bnb has terminated after 300 iterations
(bnb.maxiter). You must look at the diagnostic code from solvesdp
4.
You have a nasty nonlinear integer program, and you don't have any
efficient solver for this. YALMIP has picked the only possible choice
on your machine, which is the internal solver bnb, which is really slow,
and assumes convexity of your relaxations (which I doubt you have). Thus, failure...
5.
You can easily write this as a milp. Work with the inverse of B as the
variables instead. An element in Binv will be quantized to 1, 1/2,
1/3,..,1/200. Hence, create a variable which is constrained to those
values
% Possible values
quants = 1./(1:200);
% write every Binv_i = di1*1 + di2*1/2 + di3*1/3+...
% and add di1+di2+...+di200 == 1
d = binvar(200, length(F));
Binv = quants*d;
obj = lambda' * (F .* (Binv)');
S = (F - (20 * F) .* (Binv') - (20 / 0.02)) .* lambda;
constraints = [sum(d,1)==1, S >= 0, sum(S) == 6000000];
solvesdp(constraints,obj)
The problem is infeasible though (which thus explains why bnb failed). The closest you can get the sum to is 7.5417e+06
sdpvar t
constraints = [sum(d,1)==1, S >= 0, sum(S) == t];
solvesdp(constraints,abs(t-6000000))