Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (20 sloc)
476 Bytes
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
function stdM = standardizeMatrix(M) | |
% STANDARDIZEMATRIX | |
% Return a standardized version of matrix M where all entries are in range[0,1]. | |
% | |
% INPUT PARAMS | |
% Param M (matrix) | |
% Input matrix that is to be standardized | |
% | |
% OUTPUT PARAMS | |
% Param stdM (matrix) | |
% Output matrix | |
% | |
% ADDITIONAL NOTES | |
% | |
% Author: snikumbh@mpi-inf.mpg.de | |
stdM = zeros(size(M)); | |
mins = repmat(min(M,[],2), 1,size(M,2)); | |
maxs = repmat(max(M,[],2), 1,size(M,2)); | |
stdM = (M - mins)./(maxs - mins); | |
end |