Normalizator v1.0

Version 1.0.0 (1.4 KB) by Bech Tnn
This function purpose is to normalize a TABLE or a subtable (Defined by the Index_1 and Index_2 columns) to a values X_norm.
5 Downloads
Updated 9 Mar 2020

View License

function matrix=Normalizator(TABLE,Index_1,Index_2,X_norm)
% By tonin bechon
% 09/03/2020 - v1.0 - This code may be used / shared and modified as wished
% - No licence is required.
%
% This function purpose is to normalize a TABLE or a subtable (Defined by
% the Index_1 and Index_2 columns) to a values X_norm. For normalizing a full table, set Index_1 as 1 and Index_2 as end or as size(TABLE, 2)

% EXAMPLE :
% I want to normalize the values to 100 of some columns of my table (lets
% say columns 11 to 20). I should write one of these two lines :

% TABLE(:,11:20)=Normalizator(TABLE,11,20,100)
% to replace the previous values OR :

% NewTABLE=Normalizator(TABLE,11,20,100)
% to export the normalized values in a new table.

% CODE :
%get headers
header=TABLE.Properties.VariableNames(Index_1:Index_2);
%get numbers
matrix=table2array(TABLE(:,Index_1:Index_2));

%Normalize
matrix=X_norm.*matrix./sum(matrix,2);
%Create output table with headers
matrix=array2table(matrix,'VariableNames',header);

end

Cite As

Bech Tnn (2026). Normalizator v1.0 (https://www.mathworks.com/matlabcentral/fileexchange/74466-normalizator-v1-0), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0