1 function [o]=sumsq(x,DIM)
2 % SUMSQ calculates the sum of squares.
4 % [y] = sumsq(x [, DIM])
7 % N STD of N-th dimension
8 % default or []: first DIMENSION, with more than 1 element
10 % y estimated standard deviation
13 % - can deal with NaN's (missing values)
14 % - dimension argument also in Octave
15 % - compatible to Matlab and Octave
17 % see also: RMS, SUMSKIPNAN, MEAN, VAR, MEANSQ,
23 % This program is free software; you can redistribute it and/or modify
24 % it under the terms of the GNU General Public License as published by
25 % the Free Software Foundation; either version 2 of the License, or
26 % (at your option) any later version.
28 % This program is distributed in the hope that it will be useful,
29 % but WITHOUT ANY WARRANTY; without even the implied warranty of
30 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 % GNU General Public License for more details.
33 % You should have received a copy of the GNU General Public License
34 % along with this program; If not, see <http://www.gnu.org/licenses/>.
37 % Copyright (C) 2009,2010 by Alois Schloegl <alois.schloegl@gmail.com>
38 % This function is part of the NaN-toolbox
39 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
45 DIM = find(size(x)>1,1);
46 if isempty(DIM), DIM=1; end;
49 [s,n,o] = sumskipnan(x,DIM);