MATLAB: How to normalize data between 0 and 1 , each column

min_maxnormalizationseprate column

i have data that has 13 column and 194 row. i want to normalize each column between 0 and 1 and i want to use min_max method. what should i do? i don't know matlab a lot. plz help me. thank you.

Best Answer

This will normalize each column (assuming no NaN, Inf, or complex):
x = [min(a,[],1);max(a,[],1)]
b = bsxfun(@minus,a,x(1,:));
b = bsxfun(@rdivide,b,diff(x,1,1))