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

is_prime (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: membership

Requires: MathScript RT Module

Syntax

c = is_prime(a)

Legacy Name: isprime

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 = is_prime([5, 7, 6, 789])

C = is_prime('der')

Related Topics

factor
primes


 

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