First Example

Use the command A = [ 3 1; 9 3] to define A to be the 2x2 matrix of this example, whose first row is 3, 1 and whose second row is 9, 3. (See enter matrices.) Next give the command G = newhat(A) to define G to be the augmented matrix with which the transformations shown at the bottom of page 20 begin. (Note that the entry in the lower right corner is 2, the number of rows in A, not 0. The reason for this is that, when the transformations are complete, there needs to be a way for Matlab to determine the sizes of the matrices involved. See newhat or unhat. )

Then perform row and column operations that transform G into a matrix in which the upper left 2x2 corner is diagonal. These operations are, when the algorithm of Section 7 is followed, to subtract the second column from the first twice, then subtract the first column from the second, and, finally, subtract the first row three times from the second. The Matlab commands to accomplish these operations are:

Remember, you do not need to type out these entire commands! After you type in the first one, use the `up arrow' key for the others, and just make the few modifications that are needed. (The second command is the same as the first. In the third, the last two numbers 2, 1 need to be changed to 1, 2. In the fourth, the first number needs to be changed from 2 to 1 (i.e., from specifying a column operation to specifying a row operation). The fifth and sixth commands are repeats of the fourth.

As is explained in Section 8, the final matrix G has a unimodular matrix M in its upper right corner and a unimodular matrix N in its lower left corner, and these matrices have the property that MAN is the diagonal matrix in the upper left corner.

The matrices M, N, and D can be retrieved using the command [D, M, N] = unhat(G). For an explanation of this command, see unhat. Otherwise, return to Chapter 2.