EXTREMA Function

Standard Library function that finds the local extrema in an array.

Usage

    result = EXTREMA(array)

Input Parameters

array—The array for which the local extrema will be found.

Returned Value

result—A list containing two vectors of indices into array. result(0) contains the local minima and result(1) contains the local maxima.

Keywords

None.

Examples

e = EXTREMA( [0, 1, 2, 2, 2, 3, 2, 1, 3] )  &  PM, e(0), ' '  &  PM, e(1)
a = BYTSCL( RANDOMU(s,5,5), Top=9 )         &  PM, a
e = EXTREMA( a )                            &  PM, e(0), ' '  &  PM, e(1)

See Also

MAX, MIN