Rescale X to [0-1], X = (X-min(X))/(max(X)-min(X).