Contents Previous Next Subchapters

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

Description
In Mlmode , determines if all 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 all 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 all of the elements in the j-th column of x are true.

all(
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 all 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 all 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 ]
     all(x)
O-Matrix will respond
     [ T , T , F ]