


Report the number of non singleton dimensions of a matlab array.


0001 function n = ndim(x) 0002 % Report the number of non singleton dimensions of a matlab array. 0003 0004 %@info: 0005 %! @deftypefn {Function File} {@var{n} =} ndim (@var{x}) 0006 %! @anchor{ndim} 0007 %! This function reports the number of non singleton dimensions of a matlab array. 0008 %! 0009 %! @strong{Inputs} 0010 %! @table @var 0011 %! @item x 0012 %! Matlab array. 0013 %! @end table 0014 %! 0015 %! @strong{Outputs} 0016 %! @table @var 0017 %! @item n 0018 %! Integer scalar. The number of non singleton dimensions of a matlab array. 0019 %! @end table 0020 %! 0021 %! @strong{This function is called by:} 0022 %! @ref{demean}, @ref{nandemean}. 0023 %! 0024 %! @strong{This function calls:} 0025 %! none. 0026 %! 0027 %! @end deftypefn 0028 %@eod: 0029 0030 % Copyright (C) 2011 Dynare Team 0031 % stephane DOT adjemian AT ens DOT fr 0032 % 0033 % This file is part of Dynare. 0034 % 0035 % Dynare is free software: you can redistribute it and/or modify 0036 % it under the terms of the GNU General Public License as published by 0037 % the Free Software Foundation, either version 3 of the License, or 0038 % (at your option) any later version. 0039 % 0040 % Dynare is distributed in the hope that it will be useful, 0041 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0042 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0043 % GNU General Public License for more details. 0044 % 0045 % You should have received a copy of the GNU General Public License 0046 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0047 0048 n = sum(size(x)>1);