dash.is.positiveIntegers

Test if a numeric array consists entirely of positive integers


Syntax



Description

tf = dash.is.positiveIntegers(X)

Return true if X consists entirely of positive integers. Return false otherwise.

[tf, loc] = dash.is.positiveIntegers(X)

If X is not all positive integers, also return the index of the first element that is not a positive integer.


Input Arguments

X

numeric array
The array being tested

Output Arguments

tf

scalar logical
True if X consists entirely of positive integers. False otherwise

loc

[] | scalar linear index
If X is positive integers, an empty array. Otherwise, the index of the first element that is not a positive integer