Table Of Contents

is_prime

Version:
    Last Modified: March 15, 2017

    Determines whether elements of an array of any dimension are prime numbers. A natural number is prime if and only if the only divisors of that number are 1 and the number itself.

    Syntax

    c = is_prime(a)
    Legacy name: isprime

    Inputs

    a

    Array of any dimension of real values.

    Outputs

    c

    Array of any dimension of Boolean values. An element in c is 1 if and only if the corresponding element of a is a prime number. Otherwise, the element is 0. c is of the same size as a.

    C = is_prime([5, 7, 6, 789])

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics