AMax

(Engine-Level Function)

Description: Array maximum. This function returns the maximum value in a sub-range of a numeric array.
Returns: Numeric
Usage: Script or steady state.
Function Groups: Array,  Generic Math
Related to:

AMin| Array Functions

Format: AMax(ArrayElem, N)
Parameters:  
ArrayElem
Required.  A numeric array element. The subscript(s) for the array may be any numeric expression, specifying the starting point for the array maximum search.
N
Required.  Any numeric expression giving the number of array elements to use starting at the element given by the first parameter.
If N extends past the upper bound of the lowest array dimension, this computation will "wrap-around" and resume at element 0 until N elements have been processed.
Comments: AMax ignores invalid array entries. It only returns invalid if the array subscript is invalid, N is invalid, or if all of the array entries in the specified range are invalid. If processing a multidimensional array, the usual rules apply to decide which dimension should be examined.

Example:

  highVal = AMax(trendData[0] { Start at element 0 }, 100 { Search through 100 elements });

This example sets highVal to the highest value of trendData elements 0 to 99. Because this function ignores invalid array elements, highVal will be some valid value unless all elements 0 to 99 are invalid.