Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

isprime (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the membership class.

Syntax

c = isprime(a)

Description

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.

Examples

Inputs

Name Description
a Specifies a matrix or a string.

Outputs

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.

Examples

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

C = isprime('der')

Related Topics

factor
primes


Resources


 

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