Here is my model:
Solving this problem, I used GA in matlab
function F = sim_fit(q,k,m)
%retailer
a(1,1)=3;a(2,1)=2;a(3,1)=3;a(1,2)=1;a(2,2)=1.1;a(3,2)=9;
d(1,1)=1850;d(2,1)=2000;d(3,1)=3000;d(1,2)=2100;d(2,2)=1300;d(3,2)=900;
hr(1,1)=2.4;hr(2,1)=1.3;hr(3,1)=38;hr(1,2)=4.5;hr(2,2)=3.6;hr(3,2)=45;
so(1,1)=3.5;so(2,1)=1.5;so(3,1)=2.5;so(1,2)=0.3;so(2,2)=0.6;so(3,2)=6.3;
t(1,1)=1;t(2,1)=1;t(3,1)=3;t(1,2)=1;t(2,2)=1;t(3,2)=3;
E(1,1)=2;E(2,1)=2;E(3,1)=10;E(1,2)=2;E(2,2)=2;E(3,2)=10;
Y(1,1)=3;Y(2,1)=3;Y(3,1)=11;Y(1,2)=3;Y(2,2)=3;Y(3,2)=11;
%vendor
S=100;
hv(1)=3.5;hv(2)=4;
C(1)=10; C(2)=50;
Cv(1)=2.4; Cv(2)=3;
Cf(1)=3; Cf(2)=1.2;
s(1)=0.3; s(2)=0.1;
the(1)=0.01; the(2)=0.03;
dv(1)=sum(d(1,1)+d(1,2));dv(2)=sum(d(2,1)+d(2,2));
Q(1)=sum(q(1,1)+q(1,2));Q(2)=sum(q(2,1)+q(2,2));
P(1)=10000; P(2)=8000;
%function
for j=1:2
for i=1:2
F= S*dv(i)/(Q(i)*m(i,j))+(hv(i)*Q(i)*((m(i)-1)*(1-dv(i)/P(i))+dv(i)/P(i)))/2+...
dv(i)*(m(i)*C(i)+m(i)*Q(i)*Cv(i)+Cf(i))+m(i)*s(i)*dv(i)*Q(i)*the(i)/2+...
a(i,j).*d(i,j)./q(i,j)+(hr(i,j).*((1-k(i,j)).^2).*q(i,j))./2+...
k(i,j).^2.*so(i,j).*q(i,j)./2+(m(i)*t(i,j).*d(i,j))./q(i,j)+(m(i)*E(i,j).*d(i,j))./q(i,j)+...
Y(i,j).*d(i,j);
end
end
end
function [C, ceq] = sim_constraint(q,k,m)
B(:,1)=200;B(:,2)=300;
W(:,1)=100;W(:,2)=100;
b(1)=10; b(2)=14;
w(1)=1; w(2)=1.5;
P(1)=10000; P(2)=8000;
C=[(m(1).*q(1,1).*b(1)+m(2).*q(2,1).*b(2))-B(:,1);
(m(1).*q(1,2).*b(1)+m(2).*q(2,2).*b(2))-B(:,2);
(m(1).*q(1,1).*w(1)+m(2).*q(2,1).*w(2))-W(:,1);
(m(1).*q(1,2).*w(1)+m(2).*q(2,2).*w(2))-W(:,2);
m(1)*Q(1)-P(1);m(2)*Q(2)-P(2)
k(1,1)-1;k(1,2)-1;k(2,1)-1;k(2,2)-1];
ceq=[d(1,1)+d(1,2)-dv(1);(d(2,1)+d(2,2))-dv(2);
(q(1,1)+q(1,2))-Q(1);(q(2,1)+q(2,2))-Q(2)];
end
First, I don't know how to input Xij which is binary variable in sim_fitness function.
Second, in order to solve this problem, I use Optimization Toolbox. Error message said "need more input variable."
How can I fix it?

Q,danddvfrom your last function.