allΒΆ
all checks if all elements of a vector or matrix are other than zero (0).
- r = all(m)
Return Value
r is a real row vector, when m is a matrix. r is a scalar, when m is a vector or scalar.
Parameters
- m
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 other than zero, calculate their absolute values.
If the argument is a vector, all will return TRUE (1) if one or more elements are not equal to zero (i.e. TRUE).
If the the argument is a matrix, all will return a column vector.
Example
* a = [0,1,1; ...
0,0,1]
* all(a)
0 0 1
See also
id-335656