Set the order of the Galois field to 16, where the order equals $${2}^{m}$$. Specify a matrix of elements that range from 0 to $${2}^{m}-1$$. Create the Galois field array.

m = 4;
x = [3 2 9; 1 2 1];
y = gf(x,m)

y = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal)
Array elements =
3 2 9
1 2 1

Create GF Sequence with Specified Primitive Polynomial

x — Input matrix matrix with all values greater than or equal to zero

Input matrix, specified as a matrix with values greater than or equal to zero. The
function uses this value to create a GF array.

If you do not specify the prim_poly input argument, each
element of x must be an integer in the range [0,
2^{m}–1].

If you specify prim_poly input argument, each element of
x must be 0 or
1.

Data Types: double

m — Order of primitive polynomial positive integer

Order of primitive polynomial, specified as a positive integer from 1 through 16.
The function uses this value to calculate the distinct number of elements in the
GF.

Primitive polynomial, specified as one of these options:

Binary row vector — This vector specifies coefficients of
prim_poly in the order of ascending powers.

Character vector or a string scalar — This value defines
prim_poly in a textual representation. For more details,
refer to polynomial character vector.

Positive integer — This value defines prim_poly in the
range [(2^{m} + 1), (2^{m+1} –
1)].

If prim_poly is not specified, see Default Primitive Polynomials for the list of default primitive
polynomial used for each Galois field array
GF(2^{m}).

x_gf — Galois field array variable that MATLAB recognizes as a Galois field array

Galois field array, returned as a variable that MATLAB recognizes as a Galois field
array, rather than an array of integers. As a result, when you manipulate the variable,
MATLAB works within the Galois field the variable specifies. For example, if you apply
the log function to a Galois array, MATLAB computes the
logarithm in the Galois field for that Galois array and not in the field of real or
complex numbers.

This table lists the default primitive polynomial used for each Galois field
array GF(2^{m}). To use a different primitive
polynomial, specify prim_poly as an input argument.
prim_poly must be in the range
[(2^{m} + 1),
(2^{m+1} – 1)] and must indicate an
irreducible polynomial. For more information, see Primitive Polynomials and Element Representations.

Value of m

Default Primitive Polynomial

Integer Representation

1

D + 1

3

2

D^{2} +
D + 1

7

3

D^{3} +
D + 1

11

4

D^{4} +
D + 1

19

5

D^{5} +
D^{2} + 1

37

6

D^{6} +
D + 1

67

7

D^{7} +
D^{3} + 1

137

8

D^{8} +
D^{4} +
D^{3} +
D^{2} + 1

285

9

D^{9} +
D^{4} + 1

529

10

D^{10} +
D^{3} + 1

1033

11

D^{11} +
D^{2} + 1

2053

12

D^{12} +
D^{6} +
D^{4} +
D + 1

4179

13

D^{13} +
D^{4} +
D^{3} +
D + 1

8219

14

D^{14} +
D^{10} +
D^{6} +
D + 1

17475

15

D^{15} +
D + 1

32771

16

D^{16} +
D^{12} +
D^{3} +
D + 1

69643

Galois Computations

This table lists the operations supported for Galois field
arrays.

Operation

Description

+ -

Addition and subtraction of Galois arrays

* / \

Matrix multiplication and division of Galois arrays

.* ./ .\

Elementwise multiplication and division of Galois arrays

^

Matrix exponentiation of Galois array

.^

Elementwise exponentiation of Galois array

' .'

Transpose of Galois array

==, ~=

Relational operators for Galois arrays

all

True if all elements of a Galois vector are nonzero

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.