Section: Elementary Functions
y = all(x,d)
where x is an n-dimensions array of logical type.
The output is of logical type. The argument d is
optional, and denotes the dimension along which to operate.
The output y is the same size as x, except that it is
singular along the operated direction. So, for example,
if x is a 3 x 3 x 4 array, and we all operation along
dimension d=2, then the output is of size 3 x 1 x 4.
If d is omitted, then the minimum is taken over all elements of
x.
all
function
--> A = [1,0,0;1,0,0;0,0,1] A = <int32> - size: [3 3] Columns 1 to 3 1 0 0 1 0 0 0 0 1
We start by calling all without a dimension argument, in which
case it defaults to testing all values of A
--> all(A) ans = <logical> - size: [1 1] 0
The all function is useful in expressions also.
--> all(A>=0) ans = <logical> - size: [1 1] 1
Next, we apply the all operation along the rows.
--> all(A,2) ans = <int32> - size: [3 3] Columns 1 to 3 1 0 0 1 0 0 0 0 1