Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

is_prime (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: membership

Requires: MathScript RT Module


c = is_prime(a)

Legacy Name: isprime


Determines whether elements of a matrix are prime numbers. A natural number is prime if and only if the only divisors of that number are 1 and the number itself.



Name Description
a Specifies a matrix or a string.


Name Description
c Returns a matrix of Boolean values. An element in c is 1 if and only if the corresponding element of a is prime. Otherwise, the element is 0. If a is a string, each element in c corresponds to a character in a. If a is a matrix, c is a matrix of the same size as a. If a is a string, c is a matrix with as many elements as there are characters in a.


The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized


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

C = is_prime('der')

Related Topics



Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit