Scale range of array elements
scales the entries of an array to the interval [0,1]. The output arrayB
= rescale(一个
)B
is the same size as一个
.
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一个
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一个
when the values of一个
are within the bounds ofinmin
andinmax
.
Ifl
andu
are not specified, thenrescale
uses the default values 0 and 1, respectively.
如果'InputMin'
name-value pair is not specified, thenrescale
sets its value to the defaultmin(A(:))
.
如果'InputMax'
name-value pair is not specified, thenrescale
sets its value to the defaultmax(A(:))
.