FUNCTION REFERENCE

isprime

True for prime elements.

True for prime elements.

Syntax

tf = isprime(x)

Elementwise test of nonnegative integers; 0 and 1 are not prime.

Example

isprime([2 4 7])   % 1 0 1

Differences from MATLAB: Real double and logical input only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.