function [new_X] = range_trans(X,subtract_min) %Reshape the data points using a range shortening transformation % Inputs: % X: input data % subtract_min: option to subtract the minimum value or not from each column % % Outputs % new_X: each column %-- inX = min(X,[],1); axX = max(X,[],1); [n,p] = size(X); denom = repmat( axX-inX, n, 1 ); if( nargin>1 ) new_X = ( X - repmat(inX,n,1) ) ./ denom; else new_X = X ./ denom; end