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: icatb_run_sdh.m
    path of file: ./repos/gift/GroupICAT/icatb/icatb_helper_functions
    
    the code of the file until where you have to start completion: function icatb_run_sdh(sdhInfo)
%% Run spatial dynamics hierarchy
%

%% Initialize variables
icatb_defaults;
global EXPERIMENTAL_TR;
global PREPROC_DEFAULT;

TR = EXPERIMENTAL_TR;

resultsDir = sdhInfo.outputDir;
load(sdhInfo.ica_parameter_file);

doDespike = 'yes';
detrend_no = 3;
tc_filter = 0.15;
covariates = 'none';

try
    detrend_no = sdhInfo.feature_params.final.tc_detrend;
    doDespike = sdhInfo.feature_params.final.tc_despike;
    tc_filter = sdhInfo.feature_params.final.tc_filter;
    covariates = sdhInfo.feature_params.final.tc_covariates;
catch
end


covariate_files = '';

    
function icatb_run_sdh(sdhInfo)
%% Run spatial dynamics hierarchy
%

%% Initialize variables
icatb_defaults;
global EXPERIMENTAL_TR;
global PREPROC_DEFAULT;

TR = EXPERIMENTAL_TR;

resultsDir = sdhInfo.outputDir;
load(sdhInfo.ica_parameter_file);

doDespike = 'yes';
detrend_no = 3;
tc_filter = 0.15;
covariates = 'none';

try
    detrend_no = sdhInfo.feature_params.final.tc_detrend;
    doDespike = sdhInfo.feature_params.final.tc_despike;
    tc_filter = sdhInfo.feature_params.final.tc_filter;
    covariates = sdhInfo.feature_params.final.tc_covariates;
catch
end


covariate_files = '';
scansToInclude = [];
if (~strcmpi(covariates, 'none'))
    try
        covariate_files = cellstr(sdhInfo.feature_params.final.tc_covariates_userdata.filesList);
        scansToInclude = sdhInfo.feature_params.final.tc_covariates_userdata.file_numbers;
    catch
    end