quant_test.zip

Data normalization of an 2 dimensional numerical array
175 Downloads
Updated 21 Jul 2014

View License

% option={'median','mean','trimean','geomean','harmean'};
%
% How it works?
% Qunatile normalization is simple and effective
% 1 Step: sort all columns amd store the sorted data and the sort index
% 2 Step: calculate the row 'median','mean','trimean','geomean','harmean'
% of the sorted data
% 3 Step: replace the original raw value with the matching quantile value
%
% ExExample with and 6 x 4 array
% Input array
%
% 668 1515 469 772
% 1148 1631 1500 593
% 439 931 449 441
% 1473 236 1711 1041
% 500 254 645 733
% 992 438 362 689
% Step 1: sorted raw data
% 439 236 362 441
% 500 254 449 593
% 668 438 469 689
% 992 931 645 733
% 1148 1515 1500 772
% 1473 1631 1711 1041

% Step 2: median value for each quantile
% 400.5
% 474.5
% 568.5
% 832
% 1324
% 1552

% Step 3: replace the original raw data value with the matching quantile
% value. This is done with the resort index
% 3 5 3 5 568.5 1324 568.5 1324
% 5 6 5 2 1324 1552 1324 474.5
% 1 4 2 1 400.5 832 474.5 400.5
% 6 1 6 6 1552 400.5 1552 1552
% 2 2 4 4 474.5 474.5 832 832
% 4 3 1 3 832 568.5 400.5 568.5

% Job done

Cite As

Dr. Jens Koopmann (2024). quant_test.zip (https://www.mathworks.com/matlabcentral/fileexchange/47286-quant_test-zip), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Shifting and Sorting Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0