1 function [o] = nansum(i,DIM)
2 % NANSUM same as SUM but ignores NaN's.
3 % NANSUM is OBSOLETE; use SUMSKIPNAN instead. NANSUM is included
4 % to fix a bug in some other versions.
11 % default or []: first DIMENSION with more than 1 element
15 % see also: SUM, SUMSKIPNAN, NANSUM
17 % $Id: nansum.m 9033 2011-11-08 20:58:07Z schloegl $
18 % Copyright (C) 2000-2003,2008 by Alois Schloegl <alois.schloegl@gmail.com>
19 % This is part of the NaN-toolbox. For more details see
20 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
22 % This program is free software; you can redistribute it and/or modify
23 % it under the terms of the GNU General Public License as published by
24 % the Free Software Foundation; either version 3 of the License, or
25 % (at your option) any later version.
27 % This program is distributed in the hope that it will be useful,
28 % but WITHOUT ANY WARRANTY; without even the implied warranty of
29 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 % GNU General Public License for more details.
32 % You should have received a copy of the GNU General Public License
33 % along with this program; If not, see <http://www.gnu.org/licenses/>.
37 o = sumskipnan(i,DIM);
42 %!assert(nansum(NaN),0)