jeudi 9 mars 2017

check answer in range otherwise do again process with random generated number check until all digit of loop in range

for k1=1:10 %set population generation limit her

pop1h(k1)=randi([200 1150],1,1 )

end

pop=pop1h*2

if pop<500;

break

else

continue

end

pop1h generate 10 random number from 200 to 1150 now need to check this answer pop=pop1h*2 if this answer is<500 than not valid again new 10 digit generate and do same process untill condition satisfy

Aucun commentaire:

Enregistrer un commentaire