A numeric or string array is searched for the specified condition and the result is returned in the return variable. The keyword DES specifies descending search order. The optional start value specifies the starting subscript. If not specified, searching begins with the first element for ascending searches and the last element for descending searches. The "rule" specifies the search rules to use and what to return:
Rule
Meaning
LOC
Subscript of first element satisfying operator
#LOC
Count the number of elements satisfying operator
LOC MAX
Subscript of maximum value
LOC MIN
Subscript of minimum value
MAX
Find and return the maximum value
MIN
Find and return the minimum value
COMPLEX Arrays
MAT SEARCH can search an array, but since the concept of linear ordering does not apply to the complex plane, greater than, less than, MIN and MAX operations are not allowed.