| Communications Toolbox | ![]() |
To extract the array elements, field order, or primitive polynomial from a variable that is a Galois array, append a suffix to the name of the variable. The table below lists the exact suffixes, which are independent of the name of the variable.
| Information | Suffix | Output Value |
|---|---|---|
| Array elements | .x | MATLAB array of type uint16 that contains the data values from the Galois array |
| Field order | .m | Integer of type double that indicates that the Galois array is in GF(2^m) |
| Primitive polynomial | .prim_poly | Integer of type uint32 that represents the primitive polynomial. The representation is similar to the description in How Integers Correspond to Galois Field Elements. |
Note If the output value is an integer data type and you want to convert it to double for later manipulation, use the double function. |
The code below illustrates the use of these suffixes. The definition of empr uses a vector of binary coefficients of a polynomial to create a Galois array in an extension field. Another part of the example retrieves the primitive polynomial for the field and converts it to a binary vector representation having the appropriate number of bits.
% Check that e solves its own minimal polynomial. e = gf(6,4); % An element of GF(16) emp = minpol(e); % The minimal polynomial, emp, is in GF(2). empr = roots(gf(emp.x,e.m)); % Find roots of emp in GF(16). % Check that the primitive element gf(2,m) is % really a root of the primitive polynomial for the field. primpoly_int = double(e.prim_poly); mval = e.m; primpoly_vect = gf(de2bi(primpoly_int,mval+1,'left-msb'),mval); containstwo = roots(primpoly_vect); % Output vector includes 2.
| Determining Whether a Variable Is a Galois Array | Speed and Nondefault Primitive Polynomials | ![]() |
© 1994-2005 The MathWorks, Inc.