fn_arrangepergroup

Contents

Syntax

[data1 npergroup] = fn_arrangepergroup(data,conds,dim[,'all'][,subconds])

Description

average individual groups separately in a dataset that splits into
several groups
Input:
- data        ND array
- conds       a vector of length size(data,dim) - indicates to which
              group does belong each repetition along dimension dim
              alternatively, a cell array of vectors of indices can be
              used that directly specifies which indices to take for each
              group
- dim         the dimension for conditions / repetitions
- 'same'/'all'    if 'same' [=default], the minimal number of repetitions
              accross all conditions will be used (possible extra
              repetitions for other conditions will be ignored); if
              'all', the maximal number of repetitions will be used
              (NaN will be placed for missing repetitions of conditions
              that have less repetitions)
- subconds    make only these conditions appear; if some conditions in
              'subconds' are not present in 'conds', the default flag is
              set to 'all' instead of 'same'
Output:
- data1       (N+1)D array: the former dimension for conditions /
              repetitions will be split between conditions and repetition
              (an extra dimension will be inserted just after 'dim')
- npergroup   number of repetition for each group (all equal if 'same')
See also fn_avgpercond

Source

Thomas Deneux

Copyright 2015-2017