Quantize non-uniformly🔗

Given a list of limits in ascending order, finds the smallest limit that is not smaller than the input value and outputs its zero-based index.


  • value: The value to compare against limits.

  • limits: A set of limits in ascending order. A N-by-1 matrix. Note that the tool does not do the sorting for you.

  • autoSortLimits: If enabled, the tool automatically sorts the limits on each invokation.

  • outputType: The type of the output, also determines accepted input types.


  • index: The zero-based index of the smallest limit that is greater than or equal to value. If value is not less than the last limit, index will be equal to the number of limits. For example, if limits is [ 0, 10 ], anything less than or equal to 0 as value gives 0, anything greater than 0 but less than 10 gives 1 and values from 10 up give 2. If limits is empty or has more than one column, index will be -1.

enum OutputType🔗

Type of the index output.


enumerator Integer🔗

The output is an integer.

In this mode, the input must be a scalar.

enumerator IntegerMatrix🔗

The output is a matrix containing integers.

In this mode, the input must be a matrix.