Communications Toolbox    

Matrix Manipulation in Galois Fields

Some basic operations that you would perform on an ordinary MATLAB array are available for Galois arrays. This section illustrates how to perform basic manipulations and how to get basic information.

Basic Manipulations of Galois Arrays

Basic array operations that you can perform on a Galois array include those in the table below. The results of these operations are Galois arrays in the same field. The functionality of these operations is analogous to the MATLAB operations having the same syntax.

Operation 
Syntax 
Index into array, possibly using colon operator instead of a vector of explicit indices
a(vector) or a(vector,vector1), where vector and/or vector1 can be ":" instead of a vector
Transpose array
a'
Concatenate matrices
[a,b] or [a;b]
Create array having specified diagonal elements
diag(vector) or diag(vector,k)
Extract diagonal elements
diag(a) or diag(a,k)
Extract lower triangular part
tril(a) or tril(a,k)
Extract upper triangular part
triu(a) or triu(a,k)
Change shape of array
reshape(a,k1,k2)

The code below uses some of these syntaxes.

Basic Information About Galois Arrays

You can determine the length of a Galois vector or the size of any Galois array using the length and size functions. The functionality for Galois arrays is analogous to that of the MATLAB operations on ordinary arrays, except that the output arguments from size and length are always integers, not Galois arrays. The code below illustrates the use of these functions.

Positions of Nonzero Elements.   Another type of information you might want to determine from a Galois array is the positions of nonzero elements. For an ordinary MATLAB array, you might use the find function. However, for a Galois array you should use find in conjunction with the ~= operator, as illustrated.


  Logical Operations in Galois Fields Linear Algebra in Galois Fields