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: optifun37.m
    path of file: ./repos/opt_matlab/第15章/例15.3
    
    the code of the file until where you have to start completion: function y=optifun37(x,data,target)
if all(x==0)
   y=inf;
else
  N=size(data,2);

    
function y=optifun37(x,data,target)
if all(x==0)
   y=inf;
else
  N=size(data,2);
  data1=data(:,find(x==1));
  m=cluster_center(data1,target);%求各类中心
  y1=cluster_dis(data1,target,m);    %类间、类内距离
  y2=crossvalindtest(data1,6,3,target);   %正确率
  y=y1-(y2-0.1*length(find(x==1))/N);
end