This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Provide default primitive polynomials for Galois field


pol = gfprimdf(m)
pol = gfprimdf(m,p)



This function performs computations in GF(pm), where p is prime. To work in GF(2m), use the primpoly function. For details, see Finding Primitive Polynomials in Primitive Polynomials and Element Representations.

pol = gfprimdf(m) outputs the default primitive polynomial pol in GF(2m).

pol = gfprimdf(m,p) returns the row vector that gives the coefficients, in order of ascending powers, of the default primitive polynomial for GF(pm). m is a positive integer and p is a prime number.


The command below shows that 2 + x + x2 is the default primitive polynomial for GF(52).

pol = gfprimdf(2,5)
pol =

     2     1     1

The code below displays the default primitive polynomial for each of the fields GF(3m), where m ranges between 3 and 5.

for m = 3:5

The output is below.

                                 1 + 2 X + X 
                                  2 + X + X 
                                 1 + 2 X + X 

Introduced before R2006a