Communications Toolbox    
primpoly

Find primitive polynomials for a Galois field

Syntax

Description

pr = primpoly(m) returns the primitive polynomial for GF(2^m), where m is an integer between 2 and 16. The Command Window displays the polynomial using "D" as an indeterminate quantity. The output argument pr is an integer whose binary representation indicates the coefficients of the polynomial.

pr = primpoly(m,opt) returns one or more primitive polynomials for GF(2^m). The output pol depends on the argument opt as shown in the table below. Each element of the output argument pr is an integer, whose binary representation indicates the coefficients of the corresponding polynomial. If no primitive polynomial satisfies the constraints, then pr is empty.

opt
Meaning of pr
'min'
One primitive polynomial for GF(2^m) having the smallest possible number of nonzero terms
'max'
One primitive polynomial for GF(2^m) having the greatest possible number of nonzero terms
'all'
All primitive polynomials for GF(2^m)
Positive integer k
All primitive polynomials for GF(2^m) that have k nonzero terms

pr = primpoly(m...,'nodisplay') prevents the function from displaying the result as polynomials in "D" in the Command Window. The output argument pr is unaffected by the 'nodisplay' option.

Examples

The example below illustrates the formats that primpoly uses in the Command Window and in the output argument pr.

The examples below illustrate the display options and the use of the opt argument.

See Also

isprimitive


  poly2trellis qaskdeco