function y=rms(x)
% function RMS(X)
% Returns root mean square of vector or matrix X

% D. Menemenlis (dimitri@ocean.mit.edu), 26 may 99

ix=find(~isnan(x));
if length(ix)>1
  y=sqrt(mean(x(ix).*x(ix)));
else
  y=nan;
end
