Scale range of array elements
scales the entries of an array to the interval [0,1]. The output array
B
= rescale(A
)B
is the same size as A
.
specifies additional parameters for scaling an array for either of the previous
syntaxes. For example, B
= rescale(___,Name,Value
)rescale(A,'InputMin',5)
sets all elements
in A
that are less than 5 equal to 5 before scaling to the range
[0,1].
B = rescale(A,l,u,'InputMin',inmin,'InputMax',inmax)
uses the
formula
l + [(A-inmin)./(inmax-inmin)].*(u-l)
to scale the elements of an array A
when the values of
A
are within the bounds of inmin
and
inmax
.
If l
and u
are not specified, then
rescale
uses the default values 0 and 1,
respectively.
If the 'InputMin'
name-value pair is not specified,
then rescale
sets its value to the default
min(A(:))
.
If the 'InputMax'
name-value pair is not specified,
then rescale
sets its value to the default
max(A(:))
.