function Pop = InitPop(Npop,NMin,NMax);

Pop = [];
for i = 1:Npop
 Ngenes = NMin + fix(rand*(NMax-NMin+1));
 ind = struct('Genes',fix(2*rand(Ngenes,1)));
 Pop = [Pop ind];
end