mustBeNonnegative
Validate that value is nonnegative
Syntax
Description
mustBeNonnegative( throws an error if
value)value is negative. A value is negative if it is less than zero.
This function does not return a value.
mustBeNonnegative calls the
ge function to determine
if the input is not negative. (since R2026a)
Class support: All numeric classes, logical, and MATLAB® classes that implement ge.
Examples
Input Arguments
Tips
mustBeNonnegativeis designed to be used for property and function argument validation.