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: construct4D.m
    path of file: ./repos/bspm/thirdparty/bramila/external/ISC_toolbox/ISCanalysis
    
    the code of the file until where you have to start completion: function B = construct4D(Params,nrSession,nrBand,corMat,varargin)
%
%
% Return 4D data matrix of either single subject's time-series or
% inter-subject correlations.
%
% inputs:
% Params - struct of analysis parameters
% nrSession - session index
% nrBand - frequency band index

    
function B = construct4D(Params,nrSession,nrBand,corMat,varargin)
%
%
% Return 4D data matrix of either single subject's time-series or
% inter-subject correlations.
%
% inputs:
% Params - struct of analysis parameters
% nrSession - session index
% nrBand - frequency band index
% corMat - type of data to load: 0 = time-series data, 1 = correlation
% matrices, 2 = phase maps
%
% Additional instructions depend