fn_avgpergroup
Contents
Syntax
[averages nrep] = fn_avgpergroup(data,conds,dim[,nrepmax])
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 - dim the dimension on which to operate averaging - nrepmax (optional) the maximal number of repetitions to use for each group: if a group has more repetitions, the extra ones are ignored; if a group has less, an error is generated. Use flag 'same' to use the number of repetitions of the smallest group.
Output: - averages ND array, its size in dimension dims is the number of groups (i.e. length(unique(conds)) ), sizes in all other dimensions are identical to those of data
See also fn_arrangepercond
Source
Thomas Deneux
Copyright 2015-2017