% rms: root mean squared. % For vectors, rms(x) returns the rms of x. % For matrices, rms(x) returns a row vector with the % rms of each column of x. % Peter Assmann - Nov. 5, 1993 function r=rms(y); [m,n]=size(y); if(m==1)+(n==1), % y is a row or column vector n=max(m,n); r=norm(y)/sqrt(n); else, r=zeros(1,n); for i=1:n, r(1,i)=norm(y(i,:))/sqrt(n); end; end;