Platform | x64, Win32 |
Purpose |
To get the first position in an array where the element has a given value. |
Class |
Transformational function. |
Syntax |
INTEGER FUNCTION FINDLOC(ARRAY, VALUE, DIM [, MASK]) |
Description |
ARRAY is an integer or real array. DIM is a scalar integer in the range 1 < DIM < n where n is the rank of ARRAY. MASK is a logical array that is conformable with ARRAY. |
Return value |
This function determines the location in the ARRAY along dimension DIM with the value VALUE, for which the elements of MASK are TRUE. If DIM is not present, the result is an array of rank one and size n, otherwise the result is of rank n - 1 and has a shape that is the same as that of ARRAY but omitting dimension DIM. |
Example |
The value of FINDLOC ([2, 6, 4, 6], VALUE = 6) is [2]. If A has the value
The value of FINDLOC ([2, 6, 4], VALUE = 6, DIM = 1) is 2. If A has the value [ 1 2 -9 ] |
Notes |
This function was introduced in the Fortran 2008 standard and is similar to MINLOC. When fully implemented it will include additional arguments: KIND and BACK. |