FUNCTION REFERENCE

mustBeNonnegative

Validate that value is nonnegative.

Validate that value is nonnegative.

Syntax

mustBeNonnegative(A)

Throws an error if any element of A is not a real, nonnegative number or logical value.

Example

mustBeNonnegative([0 1 2])

Differences from MATLAB: Duration inputs are not supported.

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