mustBePositive
Validate that value is positive
Syntax
Description
mustBePositive( throws an error if
value)value is not positive. Values are positive when they are greater
than zero. This function does not return a value.
mustBePositive calls the
gt function to determine
if the input is positive. (since R2026a)
Class support: All numeric classes, logical, and MATLAB® classes that implement gt.
This function ignores input arguments that are empty values. Therefore, no error is thrown when the property or function argument value is empty.
Examples
Input Arguments
Tips
mustBePositiveis designed to be used for property and function argument validation.