Start » Filter Reference » Data Flow » Conditional Processing » SelectByRange

SelectByRange


Module: FoundationLite

Selects the elements of the input that fall into the specified range.

Name Type Description
Input value
inArray <T>Array Elements to be classified
Input value
inValues RealArray Corresponding values to be compared against the range
Input value
inMinimum Real* Lowest value of the range
Input value
inMaximum Real* Highest value of the range
Output value
outSelected <T>Array Array of elements corresponding to values matching the range

The type of this filter is defined using the type variable T which represents any valid type. Read more.

Description

The filter accepts an array of objects of type T (decided on filter creation) along with a corresponding array of float values. It selects the objects for which the associated values fit the (inMinimum, inMaximum) range.

Hints

  • Also consider using the "select" function in formulas.
  • Before using this filter you need to have an array of objects (to be classified) and an array of feature values that describe the objects.
  • Connect the array of objects to the inArray input and connect the array of feature values to the inValues input.
  • Set the range of inMinimum and inMaximum to define the accepted objects.
  • If you also need to get the arrays of objects that were below or above the range, use the ClassifyByRange filter.

Examples

Description of usage of this filter can be found in examples and tutorial: Capsules.
inArray = {"Alice", "Bill", "Frank", "Patricia", "Thomas"}
inValues = {5.0, 4.0, 5.0, 8.0, 6.0}
inMinimum = 5.0
inMaximum = 6.0
outSelected = {"Alice", "Frank", "Thomas"}

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Inconsistent array lengths on input in SelectByRange.
DomainError Incorrect (NaN) float value on inValues input in SelectByRange.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of Select filter group.

See Also

  • ClassifyByRange – Separates the elements of the input array into three output arrays, depending on whether the related values fall below, into or above the specified range.
  • SelectByPredicate – Selects the elements from the input array for which the associated predicate is True.