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: pleManual.m
    path of file: ./repos/d2d/arFramework3/PLE
    
    the code of the file until where you have to start completion: % chi2 = pleManual(whichp,pvals)
% 
%   The parameter specified by whichp is fixed to values given by pvals.
%   Then, all other parameters are fitted. This function provides
%   the possibility to calculate a paraemters profile likelihood in a
%   user-defined range and step-size.
% 
%   The resuls are stored in ar.pleManual
%   
%   whichp  parameter index or parameter name (according to ar.pLabel)
%           Example: whichp = 12; 
%           Example: whichp = 'k_on'; 
% 
%   pvals   a vector of values for the spe
    
function provides
%   the possibility to calculate a paraemters profile likelihood in a
%   user-defined range and step-size.
% 
%   The resuls are stored in ar.pleManual
%   
%   whichp  parameter index or parameter name (according to ar.pLabel)
%           Example: whichp = 12; 
%           Example: whichp = 'k_on'; 
% 
%   pvals   a vector of values for the specified paraemeter, 
%           Example: pvals = logspace(-3,0,20);
% 
%   chi2    the merit function after fitting

function chi2 = pleManual(whichp,pvals)
if ischar(whichp)
    jp = strmatch(whichp,ar.pLabel,'exact');
    if length(jp)~=1
        error('Parameter %s not found or found multiple times in ar.pLabel',whichp);
    end