mustBeInteger
Validate that value is integer
Syntax
Description
mustBeInteger( throws an error if value)value does not contain integer values. This function tests for numbers with no fractional part. The data type of the values is not considered. mustBeInteger does not return a value.
mustBeInteger calls these
functions to determine if value is an integer: (since R2026a)
Class support: All numeric classes, logical, and MATLAB® classes that implement the functions called by
mustBeInteger.
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
mustBeIntegeris designed to be used for property and function argument validation.