MINLOC

Platform

x64, Win32, .NET

Purpose

To get the first position in an array where the element has the minimum value for the array.

Class

Transformational function.

Syntax

INTEGER FUNCTION MINLOC(ARRAY, DIM [, MASK])
INTEGER FUNCTION MINLOC(ARRAY [, MASK])
INTEGER DIM
LOGICAL 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 of the first element of ARRAY along dimension DIM having the minimum value of the elements identified by MASK.

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

If A = [3, 2, 2, 9] then MINLOC(A) is 2.

If A = then MINLOC(A, MASK = A > 3) is [1, 4] which is the location of the smallest value for this mask.

If A = then MINLOC(A, DIM = 1) is [1, 1, 1, 2] and MINLOC(A, DIM = 2) is [1, 4].

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited