isprime

Determines if x is a prime number.

Syntax

isprime(x)

Inputs

x
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
Numerical equivalent true/false.

Example

Simple isprime example:

isprime(7)
R = 1