clear
close all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global ft_default
ft_default.checksize = inf;
ft_default = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% the analysis follows the strategy outlined on https://github.com/robertoostenveld/Wakeman-and-Henson-2015

subjlist = {
  'Subject01'
  'Subject02'
  'Subject03'
  'Subject04'
  };

%%

for i=1:numel(subjlist)
  subj = subjlist{i};
  ft_default.reproducescript = ['reproduce_' subj];
  doSingleSubjectAnalysis(subj);
  ft_default.reproducescript = []; % disable
end

%%

ft_default.reproducescript = 'reproduce_Group';
doGroupAnalysis(subjlist);
ft_default.reproducescript = []; % disable
