view general/numerical/array/meandims.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents db7f4afd27c5
children
line wrap: on
line source
function A=meandims(A,dims)
% meandims - Sum over multiple dimensions
%
% meandims :: 
%    [Size:[[1,E]]->A] ~'E dimensional array',
%    Dims:[[K]->1..E]  ~'dims to sum over'
% -> [Size1->A]        :- Size1=arrset(Size,Dims,1). 
%
% Result is same size as input except for summed dimensions
% which are collapsed to a size of 1.
for i=dims, A=mean(A,i); end