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_post_process_dfnc.m
    path of file: ./repos/bspm/thirdparty/MIALAB/GroupICATv4.0a/icatb/icatb_helper_functions
    
    the code of the file until where you have to start completion: function icatb_post_process_dfnc(param_file)
%% Post process dF
    
function [corrs, states] = getStateCorr(dfncInfo, clusterInfo)
% corrs - subjects x sessions x clusters
% states - subjects x sessions x windows
outDir = dfncInfo.outputDir;

Nwin = size(clusterInfo.IDXall, 1)/(dfncInfo.userInput.numOfSess*dfncInfo.userInput.numOfSub);

% subjects x sessions x windows
states = reshape(clusterInfo.IDXall, dfncInfo.userInput.numOfSess, dfncInfo.userInput.numOfSub, Nwin);
states = permute(states, [2, 1, 3]);

count = 0;
for nSub = 1:dfncInfo.userInput.numOfSub
    for nSess = 1:dfncInfo.userInput.numOfSess
        count = count + 1;
        fn = fullfile(outDir, dfncInfo.outputFiles{count});      
        load(fn);
        tmp = squeeze(states(nSub, nSess, :));
        for nState = 1:dfncInfo.postprocess.num_clusters
            inds = find(tmp == nState);
            corrs{nSub, nSess, nState} = FNCdyn(inds, :);
        end