Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Scale range of array elements

`B = rescale(A)`

`B = rescale(A,l,u)`

`B = rescale(___,Name,Value)`

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`

.

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(:))`

.