%% standardize the data
numDsc = size(X,1);
fprintf('numDsc = %d\n',numDsc);
meanData = mean(X); % column-wise mean
meanDuplicate = meanData(ones(1,numDsc), :); % replicate
normData = X - meanDuplicate;
stdData = std(X); % column-wise std
stdData(stdData == 0) = 1; % if standard deviation is 0, set to 1 to avoid zero-denominator problems in normalization
stdDuplicate = stdData(ones(1,numDsc), :); % replicate
normData = normData ./stdDuplicate;
No comments:
Post a Comment