Mercurial > hg > ishara
view general/numerical/array/meanlastdims.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 x=meanlastdims(x,n) % meanlastdims - compute average over last n dimensions of multidim array % % Usage: y=meanlastdims(x,n) % % If size1(x) = [m(1) m(2) ... m(k)], then size1(y) = [m(1) ... m(k-n)] % MEANLASTDIMS ignores any trailing singleton dimensions including 2nd % dimension of a column vector. sz=size1(x); for d=length(sz)-(0:n-1); x=sum(x,d)/sz(d); end