% load MDM mdm = xff('*.mdm'); % load VOI voi = xff('*.voi'); % get list of conditions from first protocol prt = xff(mdm.XTC_RTC{1, 2}); conds = prt.ConditionNames; % extract average timecourses for all conditions with options: % - baseline window is from -2000 through 2000 milliseconds (sampled in 2s intervals) % - motion parameters from mdm.RunTimeVars are used (if present) to remove nuisance variance % - FFX grouping % - the sampling of the average time courses is in 100ms steps % - the error term returned is SE (SD / sqrt(N)) [fmtc, fmtcse] = mdm.VOICondAverage( ... voi, conds, struct( ... 'basewin', [-2000:1000:2000], ... 'motpars', true, ... 'group', 'ffx', ... 'samptr', 100, ... 'sdse', 'se')); % create list of colors col = [1, 0, 0; 0.8, 0.2, 0.2; 0, 0, 1; 0.2, 0.2, 0.8]; % the plots were then created as follows: % - get the VOI names vn = voi.VOINames; % loop over VOIs for vc = 1:numel(vn) % create a figure and axes object f(vc) = figure; a = axes; % loop over condidions for x=1:numel(conds) % use tcplot to plot into the same axes l(x) = tcplot(a, 0:0.1:20, fmtc(:, x, vc), fmtcse(:, x, vc), fmtcse(:, x, vc), ... struct('color', col(x, :), 'spalpha', 0.2, 'lwidth', 3)); end % add title and legend title(vn{vc}); legend(l(:), conds{:}); end end % set figures to same size set(f, 'Position', [200, 200, 400, 300]);