Chapter 2. Equivalence of Matrices

In this chapter, Matlab functions are provided for working out examples using the algorithms of Chapter 2. The main algorithm finds, for a given matrix A, unimodular matrices M and N for which MAN is a diagonal matrix.

The most basic function in the chapter is the function rcop for performing one row or column operation.

As is explained in Section 8 of Chapter 2, if row and column operations that transform A into a diagonal matrix are applied to the augmented matrix that is denoted in the book by A with a hat (circumflex) over it (bottom of page 19), the final matrix contains not only a diagonal matrix D equivalent to A but also unimodular matrices M and N such that MAN = D. The Matlab function newhat creates an augmented matrix for this purpose.

When you are done transforming the augmented matrix, you can use the Matlab function unhat to break it apart and find the diagonal matrix D, along with the unimodular matrices M and N. If you want to put D, M, and N back together after using unhat, you can use hat .

See first example for a description of how the first example in the Examples section of Chapter 2 (page 20) can be worked through using the above functions.

The function algo automatically applies the algorithm of Section 7 to a matrix in hat format.

The function algo2 is like algo, but it uses a somewhat different algorithm that works better for large matrices. A further variant is quick, which carries the algorithm all the way to the end and merely gives the end result.

Suggested excursions: Other `rcop' operations. Generate your own examples. Unimodular matrices. When are diagonal matrices equivalent? The Euclidean algorithm. Generating examples using Matlab functions.

Another view of the algorithm of Section 8 bypasses the use of tilts.

Return to Table of Contents.