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: objbran.m
    path of file: ./repos/GA-Toolbox/Test_fns
    
    the code of the file until where you have to start completion: % OBJBRAN.M      (OBJective function for BRANin RCOS function)
%
% This function implements the BRANIN RCOS function.
%
% Syntax:  ObjVal = objbran(Chrom,rtn_type)
    
function
   elseif Nvar == 2
      % BRANIN's RCOS function
      % -5 <= x1 <= 10 ; 0 <= x2 <= 15
      % global minimum at (x1,x2)=(-pi,12.275), (pi,2.275), and
      %                           (9.42478,2.475) ; fmin=0.397887
      x1 = Chrom(:,1);
      x2 = Chrom(:,2);
      ObjVal = 1*(x2-(5.1/(4*pi^2))*x1.^2+(5/pi)*x1-6).^2+10*(1-(1/(8*pi))).*cos(x1)+10;
   % otherwise error, wrong format of Chrom
   else
      error('size of matrix Chrom is not correct for function evaluation');
   end