Skip to main content

scaleToBounds.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function scales the values to a unit interval of [-0.5 to 0.5]
%
% (Array of number, number, number) -> (Array of number)
% Scales vector to within bounds


function scaledValue = scaleToBounds(value, maximum, minimum)
scaledValue = (value - (maximum + minimum) / 2) ./ (maximum - minimum);
end