Created
September 3, 2013 15:06
-
-
Save erogol/6425136 to your computer and use it in GitHub Desktop.
Data normalization columnwise
This file contains hidden or 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
% | |
% Normalize data columnwise to reduce different unit's effect | |
% | |
function[X_norm, val] = normalize_data(X,val) | |
% if ~exist('va','var') | |
% [val,ind] = max(X,[],1); | |
% end | |
% X_norm = bsxfun(@rdivide, X, val); | |
temp = max(X) - min(X); % this is a vector | |
temp = repmat(temp, [length(a) 1]); % this makes it a matrix | |
% of the same size as A | |
X_norm = X./temp; % your normalized matrix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment