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: CBIG_TRBPC_compute_multiKRR_perm_stats.m
    path of file: ./repos/CBIG/stable_projects/predict_phenotypes/ChenTam2022_TRBPC/permutation/KRR
    
    the code of the file until where you have to start completion: function CBIG_TRBPC_compute_multiKRR_perm_stats(multiKRR_dir, outstem, score_ind, perm_seed_start, ...
N_perm,site_list,outdir)

% CBIG_TRBPC_compute_multiKRR_acc_perm(multiKRR_dir,outstem,score_ind,perm_seed_start,N_perm,site_list,outdir)
%
% This function performs the permutation test for the multiKRR model and
% saves out the prediction accuracies of the permutation test
%
% Inputs:
%   - multiKRR_dir:
%     The directory wherre the multiKRR results are
%
%   - outstem
%     A string appended to the filename to specify the output files in the
%     multiKRR prediction. Must be the same as the input argument `outstem`
%     when you perform multiKRR
%
%   - score_ind
%     A scalar. The index of the score you want to perfom the permutation test.
%     Range from 1 to # Target Variables in your kernel regression
%
%   - perm_seed_start
%     A scalar. The function will do the permutation N_perm times using
%     permutation seed from perm_seed_start to perm_seed_start+N_perm-1

    
function CBIG_TRBPC_compute_multiKRR_perm_stats(multiKRR_dir, outstem, score_ind, perm_seed_start, ...
N_perm,site_list,outdir)

% CBIG_TRBPC_compute_multiKRR_acc_perm(multiKRR_dir,outstem,score_ind,perm_seed_start,N_perm,site_list,outdir)
%
% This function performs the permutation test for the multiKRR model and
% saves out the prediction accuracies of the permutation test
%
% Inputs:
%   - multiKRR_dir:
%     The directory wherre the multiKRR results are
%
%   - outstem
%     A string appended to the filename to specify the output files in the
%     multiKRR prediction. Must be the same as the input argument `outstem`
%     when you perform multiKRR
%
%   - score_ind
%     A scalar. The index of the score you want to perfom the permutation test.
%     Range from 1 to # Target Variables in your kernel regression
%
%   - perm_seed_start
%     A scalar. The function will do the permutation N_perm times using
%     permutation seed from perm_seed_start to perm_seed_start+N_perm-1
%
%   - N_perm
%     Number of permutation
%
%   - site_list
%     A text file where each line is the site ID of one subject. Permutation
%     will only be performed within sites
%
%   - outdir
%     Output directory for the permutation results
%
% Outputs:
%    prediction accuracies of the permutation test will be saved in the
%    outdir
%
% Written by Jianzhong Chen and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

if(isstr(score_ind))
    score_ind = str2num(score_ind);
end