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_pMFM_step2_generate_FCD_schaefer.m
    path of file: ./repos/CBIG/stable_projects/fMRI_dynamics/Kong2021_pMFM/part0_pMFM_data_preparation/Schaefer100/scripts
    
    the code of the file until where you have to start completion: function CBIG_pMFM_step2_generate_FCD_schaefer()

% This function is the wrapper to generate parcellated time serises and FCD
% for Desikan parcellation
%
% There is no input for this function as it can automatically get the
% output file from previous step.
% There is no output for this function as it will generate the output files

    
function CBIG_pMFM_step2_generate_FCD_schaefer()

% This function is the wrapper to generate parcellated time serises and FCD
% for Desikan parcellation
%
% There is no input for this function as it can automatically get the
% output file from previous step.
% There is no output for this function as it will generate the output files
%
% Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

FCD_result_dir = '../output/FCD';
if ~exist(FCD_result_dir,'dir')
    mkdir(FCD_result_dir)
end

generate_training_FCD()
generate_validation_FCD()
generate_test_FCD()

end


function generate_training_FCD()

% This function is the wrapper to generate parcellated FCD matrices
% for Desikan parcellation for training set
%
% There is no input for this function as it can automatically get the
% output file from previous step.
% There is no output for this function as it will generate the output files
%
% Written by Kong Xiaolu and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

TC_dir = '../output/TC/train';
file_dir = dir(TC_dir);

FCD_train_dir = '../output/FCD/train';
if ~exist(FCD_train_dir,'dir')
    mkdir(FCD_train_dir)
end