Contents Previous Next Subchapters

Determining if Any Elements are True (Mlmode)
Syntax y = any(x)
y = any(xd)
See Also O-Matrix mode , all

Description
In Mlmode , determines if any of the elements of x are true where x is a logical, integer, real, double-precision or complex matrix and true corresponds to no-zero for the numeric types.

Vector Case
If x is a vector, y is the logical scalar true if any of the elements of x are true. Otherwise it is the logical scalar false.

Empty Case
If x is an empty matrix , y is the logical scalar false.

Matrix Case
If x is not a vector or empty matrix, y is a logical row vector with the same column dimension as x. The j-th element of y is true, if any of the elements in the j-th column of x are true.

any(
xd)
If the argument d is present, it must be an integer, real or double-precision scalar equal to one or two. If d is one, y is a logical row vector with the same column dimension as x. The j-th element of y is true, if any of the elements in the j-th column of x are true. If d is two, y is a logical column vector with the same row dimension as x. The i-th element of y is true, if any of the elements in the i-th row of x are true.

Example
If in Mlmode you enter
     x = [ 0 2 0; 4 5 0 ]
     any(x)
O-Matrix will respond
     [ T , T , F ]