Created
December 4, 2012 01:51
-
-
Save seaslee/4199822 to your computer and use it in GitHub Desktop.
A fast and easy way to normalize the matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X = X./( ones(size(X)) * diag(sum(abs(X))) ); %L1-normalization | |
X = X./( ones(size(X)) * sqrt(diag(diag(X'*X))) ); %L2-normalization |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment