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: gaEP1.m
    path of file: ./repos/opt_matlab/第11章/例11.8
    
    the code of the file until where you have to start completion: function [maxx,maxf]=gaEP1(fun,popsize,iterm_max)          %进化规划算法求背包问题
a=[198 30 167 130 35 20 105 196 94 126];
b=546;
nvar=length(a);
chome=zeros(popsize,nvar);

    
function [maxx,maxf]=gaEP1(fun,popsize,iterm_max)          %进化规划算法求背包问题
a=[198 30 167 130 35 20 105 196 94 126];
b=546;
nvar=length(a);
chome=zeros(popsize,nvar);
q=round(0.9*popsize);
for i=1:popsize
   chome(i,:)=rand(1,nvar)<0.5;       %初始化变量
   chomeV(i,1)=fun(chome(i,:));
end