INRANGE (Scripts) Publisher's description
from David Fass
INRANGE tests if values are within a specified range (interval)
INRANGE tests if values are within a specified range (interval).
INRANGE(X,RANGE) tests if the values in X are within the range specified by RANGE. X can be a vector or matrix.
RANGE is a range in the form [LOW HIGH] against which each value in X will be tested. RANGE can also be a two-column vector whose ith row is of form RANGE(i,:) = [LOW HIGH]. In this form, input X must be a vector with the same length as RANGE, and each element of X is tested against the range in the corresponding row of RANGE.
INRANGE(X,RANGE,BOUNDARY) specifies whether the endpoints of the specified range should be included or excluded from the interval. The options for BOUNDARY are:
'includeboth' : Both end points included in interval (default)
'includeleft' : Left end point only included in interval
'includeright': Right end point only included in interval
'excludeboth' : Neither end point included in interval
If the LOW and HIGH values for RANGE are equal, that single value will be found in range only under the 'includeboth' option (default). Otherwise, for this case, no values will be found in range.
X = 1:10
1 2 3 4 5 6 7 8 9 10
Y = inrange(X,[5 7.2],'includeboth')
0 0 0 0 1 1 1 0 0 0
Y = inrange(X,[5 7.2],'excludeboth')
0 0 0 0 0 1 1 0 0 0
See also ISVALID.
System Requirements:MATLAB 7.1.0 (R14SP3)
Program Release Status: New Release
Program Install Support: Install and Uninstall