1 function o=rms(x,DIM,W)
2 % RMS calculates the root mean square
3 % can deal with complex data.
10 % N STD of N-th dimension
11 % default or []: first DIMENSION, with more than 1 element
12 % W weights to compute weighted s.d. (default: [])
13 % if W=[], all weights are 1.
14 % number of elements in W must match size(x,DIM)
16 % y estimated standard deviation
19 % - can deal with NaN's (missing values)
21 % - dimension argument also in Octave
22 % - compatible to Matlab and Octave
24 % see also: SUMSKIPNAN, MEAN
27 % This program is free software; you can redistribute it and/or modify
28 % it under the terms of the GNU General Public License as published by
29 % the Free Software Foundation; either version 2 of the License, or
30 % (at your option) any later version.
32 % This program is distributed in the hope that it will be useful,
33 % but WITHOUT ANY WARRANTY; without even the implied warranty of
34 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 % GNU General Public License for more details.
37 % You should have received a copy of the GNU General Public License
38 % along with this program; If not, see <http://www.gnu.org/licenses/>.
41 % $Id: rms.m 8223 2011-04-20 09:16:06Z schloegl $
42 % Copyright (C) 2000-2003,2008,2009 by Alois Schloegl <alois.schloegl@gmail.com>
43 % This function is part of the NaN-toolbox
44 % http://pub.ist.ac.at/~schloegl/matlab/NaN/
48 [o,N,ssq] = sumskipnan(x);
50 [o,N,ssq] = sumskipnan(x,DIM);
52 [o,N,ssq] = sumskipnan(x,DIM,W);