view general/arrutils/numdims.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents e44f49929e56
children
line wrap: on
line source
function n=numdims(x)
% numdims - Dimension of multidimensional array
%
% numdims :: [Size] -> natural.
%
% n=numdims(x), where n=length(size1(x)), ie not counting any
% trailing singleton dimensions. Eg
%    numdims(1)=0
%    numdims([1;2;3])=1
%    numdims([1 2 3])=2

sz=size(x);
n=length(sz);
while n>0 && sz(n)==1, n=n-1; end;