dash.assert.positiveIntegers

Throw error if numeric array does not consist entirely of positive integers


Syntax



Description

dash.assert.positiveIntegers(X)

Throws an error if the input is not an array consisting only of positive integers. Here, “integer” does not refer to the underlying data type of the array, but rather the values of the array elements. An array of type “double” will pass the assertion if all elements are positive integers. Values of NaN and Inf are not considered integers here.

dash.assert.positiveIntegers(X, name, header)

Customize thrown error message and ID.


Input Arguments

X

numeric array
The numeric array being tested

name

string scalar
The name of the input to use in error messages