% find indices of two groups group1 = find(~isemptycell(regexpi(vmp.MapNames, 'group1'))); group2 = find(~isemptycell(regexpi(vmp.MapNames, 'group2'))); groups = [group1(:); group2(:)]; ngroup1 = numel(group1); ngroup2 = numel(group2); ngroups = ngroup1 + ngroup2; % create formula formula = sprintf( ... 'robustnsamplet_img($1:%d, [zeros(%d, 1); ones(%d, 1)])', ... ngroups, ngroup1, ngroup2); % options cfopts = struct( ... 'mapsel', groups, ... 'name', 'robust two-sample t-test: group1 > group2', ... 'DF1', ngroups - 2); % compute vmp.ComputeFormula(formula, cfopts);