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:

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

This function is called by:

- nt_bias_cluster [c0,c1,A,todss,pwr0,pwr1]=nt_bias_cluster(x,dsr,flags) - cluster covariance
- nt_cluster_jd [IDX,todss,SCORE,COVS]=nt_cluster_jd(x,dsr,smooth,flags,init,verbose) - cluster with joint diagonalization
- nt_normrow y=nt_normcol(x) - normalize each row so its msq is 1

## 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