range
Range of values
Description
returns the difference between the maximum and minimum values of sample data in
y = range(X)X.
If
Xis a vector, thenrange(X)is the range of the values inX.If
Xis a matrix, thenrange(X)is a row vector containing the range of each column inX.If
Xis a multidimensional array, thenrangeoperates along the first nonsingleton dimension ofX, treating the values as vectors. The size of this dimension becomes 1 while the sizes of all other dimensions remain the same. IfXis an empty array with first dimension 0, thenrange(X)returns an empty array with the same size asX.
Examples
Input Arguments
Output Arguments
Tips
rangetreatsNaNs as missing values and ignores them.rangeprovides an easily calculated estimate of the spread of a sample. Avoid usingrangewith data that has outliers because they have an undue influence on this statistic.
Extended Capabilities
Version History
Introduced before R2006a
