This is part of the HicEst documentation
MAXLOC: Location of Maximum Value in an Array
The MAXLOC function finds the linear maximum value element position of an array, while MAX finds the maximum value.
⇾Home
⇾Contents
⇾more Programming
⇾ Examples
Bookmarks:
⇾maximum_value_location
MAXLOC returns the
maximum_value_location
of the
scalar arguments or the array argument:
result = MAXLOC( x, y, z, ...)
! x, y, z are numeric scalars, e.g.:
largest_loc = MAXLOC( 4, -3.1,
EXP
(1) )
! sets largest_loc to 1
REAL
:: vec(5)
vec =
RAN
( 100, 10)
! e.g. 96.00351636 90.99435447 108.1637875 91.95317195 90.80626762
result = MAXLOC(vec)
! set to 3
a character string:
MAXLOC("Hello World")
! returns 9 == position of "r"
MAX
is to find the
maximum value
, e.g.:
value =
MAX
( vec )
! is set to 108.1637875
analogous functions are
MIN
and
MINLOC
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.