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: selection.m
    path of file: ./repos/Mathematical-Modeling/模型与算法集合/genetic/ga_algorithm_theory
    
    the code of the file until where you have to start completion: %子程序：新种群选择操作, 函数名称存储为selection.m
function seln=selection(population
    
function seln=selection(population,cumsump);
%从种群中选择两个个体
for i=1:2
   r=rand;  %产生一个随机数
   prand=cumsump-r;
   t = find(prand >= 0);
   j=1;
   while prand(j)<0
       j=j+1;
   end