How to normalize data which contain positive and negative numbers into 0 and 1? you can refer sample of my data below. I have tried but am getting an error which says data dimension must agree. Any suggestion, please. Thank you!

7 views (last 30 days)
Datatraning = 100.*randn(300,1552)
minVal = min(Datatraning);
maxVal = max(Datatraning);
norm_data = (Datatraning - minVal) / ( maxVal - minVal )
Datatraining=[-51.6266980068282 260.373726514691 -1040.96015167892 255 -52.6288579705138 95.7235349174854
-49.8245562897936 298.367268515596 -900.490111536352 255 -49.9703056795758 108.101521100263
-36.2057603415223 398.270463317273 -749.608432372270 255 -49.5514320195152 118.634907748186
-34.2981982381135 435.407482297911 -38.4773520065891 255 -39.5337029802548 176.756214679240]

Accepted Answer

Walter Roberson
Walter Roberson on 4 Sep 2015
minVal = min(Datatraning(:));
maxVal = max(Datatraning(:));

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!