anyΒΆ

any checks if any elements of a vector or matrix are zero.

r = any(m)

Return Value

r is a real row vector,when m is a matrix. r is a scalar when m is a vector or a scalar.

Parameters

m

is a real matrix, vector or scalar.

Comment

The argument must be real. In order to check if all elements of a complex vector are different from zero, calculate their absolute values.

If the argument is a vector, any will return TRUE (1) if one or more elements are not equal to zero (i.e. TRUE).

If the the argument is a mtrix, any will return a column vector.

Example

* a = [0,1,1; ...
       0,0,1]
* any(a)
   0 1 1

id-1001498