全部
确定所有数组元素是非零还是真的
描述
tests along the first array dimension ofB
= all(A
)A
whose size does not equal 1, and determines if the elements are all nonzero or logical1
(真的
). In practice,全部
is a natural extension of the logical AND operator.
如果
A
是一个向量,然后所有(a)
returns logical1
(真的
) if all the elements are nonzero and returns logical0
(false
) if one or more elements are zero.如果
A
is a nonempty matrix, then所有(a)
treats the columns ofA
as vectors and returns a row vector of logical1
s and0
s.如果
A
is an empty 0-by-0 matrix, then所有(a)
returns logical1
(真的
).如果
A
是一个多维数组,然后所有(a)
acts along the first array dimension whose size does not equal 1 and returns an array of logical values. The size of this dimension becomes1
, while the sizes of all other dimensions remain the same.