gfprimdf

Provide default primitive polynomials for Galois field

Syntax

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

Description

Note

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.

Examples

collapse all

Find the default primitive polynomial for GF(52) by using the gfprimdf function. Then use the gfpretty function to display it in polynomial format.

pol = gfprimdf(2,5)
pol = 1×3

     2     1     1

gfpretty(pol)
 
                                           2
                                  2 + X + X 

Find the default primitive polynomials for a range of Galois fields by using the gfprimdf function.

Use the gfpretty function to display the default primitive polynomial for each of the fields GF(3m), where the range for m is [3, 5].

for m = 3:5
   gfpretty(gfprimdf(m,3))
end
 
                                            3
                                 1 + 2 X + X 
 
                                           4
                                  2 + X + X 
 
                                            5
                                 1 + 2 X + X 
Introduced before R2006a