Home > NoiseTools > nt_normrow.m

nt_normrow

PURPOSE ^

y=nt_normcol(x) - normalize each row so its msq is 1

SYNOPSIS ^

function x=nt_normrow(x)

DESCRIPTION ^

 y=nt_normcol(x) - normalize each row so its msq is 1
 
   y: normalized data

   x: data to normalize

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function x=nt_normrow(x)
0002 % y=nt_normcol(x) - normalize each row so its msq is 1
0003 %
0004 %   y: normalized data
0005 %
0006 %   x: data to normalize
0007 %
0008 
0009 if ndims(x)>2
0010     s=size(x);
0011     x=nt_normrow(reshape(x,[x,prod(s(2:end))]));
0012     x=reshape(x,s);
0013 else
0014     w=1./sqrt(mean(x.^2,2));
0015     w(find(isnan(w)))=0;
0016     x=bsxfun(@times,x,w);
0017 end
0018 
0019

Generated on Sat 29-Apr-2023 17:15:46 by m2html © 2005