0001 function separate_meg(p)
0002
0003
0004
0005
0006
0007 disp(mfilename);
0008
0009
0010 data_file = fullfile(p.proj_root, p.meg_dirname, p.trial_dirname, 'rri_all.info.mat');
0011 load(data_file, 'fileinfo', 'Measurement')
0012
0013
0014 trial_ix = find(fileinfo.ActiveTrial == 1);
0015 cond = fileinfo.cond_id(trial_ix);
0016
0017
0018 for ta = unique(p.cond_list)
0019 fileinfo.ActiveTrial = zeros(1, fileinfo.Ntotal);
0020 fileinfo.ActiveTrial(trial_ix(cond == ta)) = 1;
0021 save_file = fullfile(p.proj_root, p.meg_dirname, p.trial_dirname, ...
0022 ['rri_' p.task_list{ta} '.info.mat']);
0023 save(save_file, 'fileinfo', 'Measurement')
0024 disp(['Ntrials for task ' p.task_list{ta} ': ' num2str(length(find(fileinfo.ActiveTrial == 1)))])
0025 end