You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sel.m
    path of file: ./repos/Algorithms_MathModels/HeuristicAlgorithm（补分启发式算法，包括神经网络、模拟退火、遗传算法）/遗传算法/遗传算法求解函数优化问题
    
    the code of the file until where you have to start completion: %“选择”操作
function seln=sel(s,p);

inn=size(p,1);

%从种群中选择两个个体
for i=1:2
   r=rand;  %
    
function seln=sel(s,p);

inn=size(p,1);

%从种群中选择两个个体
for i=1:2
   r=rand;  %产生一个随机数
   prand=p-r;
   j=1;
   while prand(j)<0
       j=j+1;
   end