isprimitive

True for primitive polynomial for a Galois field

Syntax

isprimitive(a) 

Description

isprimitive(a) returns 1 if the polynomial that a represents is primitive for the Galois field GF(2m), and 0 otherwise. The input a can represent the polynomial using one of these formats:

Examples

The example below finds all primitive polynomials for GF(8) and then checks using isprimitive whether specific polynomials are primitive.

a = primpoly(3,'all','nodisplay'); % All primitive polys for GF(8)

isp1 = isprimitive(13) % 13 represents a primitive polynomial.

isp2 = isprimitive(14) % 14 represents a nonprimitive polynomial.

The output is below. If you examine the vector a, then notice that isp1 is true because 13 is an element in a, while isp2 is false because 14 is not an element in a.

isp1 =

     1


isp2 =

     0

See Also

primpoly, Galois Field Computations


© 1994-2005 The MathWorks, Inc.