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.

Range of values

`y = range(X)`

`y = range(X,'all')`

`y = range(X,dim)`

`y = range(X,vecdim)`

returns the difference between the maximum and minimum values of sample data in
`y`

= range(`X`

)`X`

.

If

`X`

is a vector, then`range(X)`

is the range of the values in`X`

.If

`X`

is a matrix, then`range(X)`

is a row vector containing the range of each column in`X`

.If

`X`

is a multidimensional array, then`range`

operates along the first nonsingleton dimension of`X`

, treating the values as vectors. The size of this dimension becomes 1 while the sizes of all other dimensions remain the same. If`X`

is an empty array with first dimension 0, then`range(X)`

returns an empty array with the same size as`X`

.

`range`

treats`NaN`

s as missing values and ignores them.`range`

provides an easily calculated estimate of the spread of a sample. Avoid using`range`

with data that has outliers because they have an undue influence on this statistic.