FUNCTION REFERENCE

any

True if any element is nonzero.

True if any element is nonzero.

Syntax

any(A)

For a vector it returns one logical value. For a matrix it returns a row with one value per column.

Example

any([0 0 2])   % true

Example

any(zeros(2,2,2),'all')   % 0

Differences from MATLAB: No dim argument for 2-D input; real or logical 2-D arrays. N-D arrays (part 2): dim, vecdim and 'all' with numeric, logical, char and complex input; NaN is ignored, as documented.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.