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: Cross.m
    path of file: ./repos/Algorithms_MathModels/MATLAB智能算法30个案例分析/chapter2 基于遗传算法和非线性规划的函数寻优算法/案例2非线性
    
    the code of the file until where you have to start completion: function ret=Cross(pcross,lenchrom,chrom,sizepop,bound)
%本函数完成交叉操作

    
function ret=Cross(pcross,lenchrom,chrom,sizepop,bound)
%本函数完成交叉操作
% pcorss                input  : 交叉概率
% lenchrom              input  : 染色体的长度
% chrom                 input  : 染色体群
% sizepop               input  : 种群规模
% ret                   output : 交叉后的染色体

for i=1:sizepop 
    
    % 随机选择两个染色体进行交叉
    pick=rand(1,2);
    while prod(pick)==0
        pick=rand(1,2);
    end