Platform | x64, Win32, .NET |
Purpose |
To test if any of the elements in a logical array are true. |
Class |
Transformational function. |
Syntax |
LOGICAL FUNCTION ANY(MASK [,DIM]) |
Description |
MASK is a logical array. DIM is optional and is a value in the range 1 < DIM < n where n is the rank (i.e. the number of dimensions) of MASK. ANY returns a logical array or scalar whose kind type is the same as an element of MASK. If MASK has rank 1 or if DIM is not present then ANY returns a scalar otherwise ANY returns an array whose rank is one less than that of MASK. If MASK has rank 1 then a supplied value of DIM is ignored. |
Return value |
ANY(MASK) returns the scalar value true if any of the elements of MASK are true. It returns false if all of the elements of MASK is false. If MASK has rank n greater than 1 then ANY(MASK, DIM) returns a logical array of rank n - 1 whose elements are given by ANY(MASK) applied along dimension DIM. |
Example |
If MASK = then ANY(MASK, 1) returns [true, true, false] whilst ANY(MASK, 2) returns [true, true] |