isprime
Determine which array elements are prime.
📝Syntax
TF = isprime(X)
📥Input Arguments
Parameter Description
X a scalar, vector, or matrix of nonnegative integers.
📤Output Arguments
Parameter Description
TF logical array, true where the corresponding element of X is a prime number.
📄Description

isprime returns a logical array the same size as X, containing true where the elements of X are prime numbers and false where they are not.

💡Examples
isprime([2 3 4 5 6 7 8 9 10 11])
🔗See Also
primesfactorgcd
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub