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_LiGSR_NchooseD_families.m
    path of file: ./repos/CBIG/stable_projects/preprocessing/Li2019_GSR/VarianceComponentModel/scripts/utilities
    
    the code of the file until where you have to start completion: function CBIG_LiGSR_NchooseD_families( fullsub_list, family_csv, family_header, subject_header, ...
    d, num_samples, outdir, output_prefix )

% CBIG_LiGSR_NchooseD_families( fullsub_list, family_csv, family_header, ...
%     d, num_samples, outdir, output_prefix )
% 
% This function creates a list of subjects to be removed for each delete-d
% jackknife sample.
% 
% Inputs:
%   - fullsub_list
%     A string. The full subject list (full path). Each line is one subject ID.
%    
%   - family_csv
%     A string. The full path of the CSV file that contains the family
%     information of all subjects. When all subjects are independent, you
%     can input 'NONE'.
% 
%   - family_header
%     A string corresponding to the header of the family ID column in
%     "family_csv" file. When all subjects are independent, you can input
%     'NONE'.
% 
%   - subject_header
%     A string that corresponds to the header of the subject ID column in
%     "family_csv" file. When all subjects are independent, you can input
%     'NONE'.
%   
%   - d
%     A scalar or a string, the number of subjects to be removed for each
%     jackknife sample, e.g. 431.
% 
%   - num_samples
%     A scalar or a string, the total number of jackknife samples, e.g.

    
function CBIG_LiGSR_NchooseD_families( fullsub_list, family_csv, family_header, subject_header, ...
    d, num_samples, outdir, output_prefix )

% CBIG_LiGSR_NchooseD_families( fullsub_list, family_csv, family_header, ...
%     d, num_samples, outdir, output_prefix )
% 
% This function creates a list of subjects to be removed for each delete-d
% jackknife sample.
% 
% Inputs:
%   - fullsub_list
%     A string. The full subject list (full path). Each line is one subject ID.
%    
%   - family_csv
%     A string. The full path of the CSV file that contains the family
%     information of all subjects. When all subjects are independent, you
%     can input 'NONE'.
% 
%   - family_header
%     A string corresponding to the header of the family ID column in
%     "family_csv" file. When all subjects are independent, you can input
%     'NONE'.
% 
%   - subject_header
%     A string that corresponds to the header of the subject ID column in
%     "family_csv" file. When all subjects are independent, you can input
%     'NONE'.
%   
%   - d
%     A scalar or a string, the number of subjects to be removed for each
%     jackknife sample, e.g. 431.
% 
%   - num_samples
%     A scalar or a string, the total number of jackknife samples, e.g.
%     1000.
% 
%   - outdir
%     A string. The full path of the output directory.
%   
%   - output_prefix
%     A string, the prefix to the filename of each output subject list. The
%     output filenames will be
%     [outdir '/' output_prefix '_choose' num2str(d) '_set' num2str(i) '.txt']
%     where i ranges from  1 to num_samples.
% 
% Written by Jingwei Li and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

[sub_names, num_sub] = CBIG_text2cell(fullsub_list);

if(ischar(d))
    d = str2num(d);
end