© 2001 by CRC Press LLC
2. Write a program Invert3 which inverts a given 3 × 3 matrix [A] by using
the cofactor method. A subroutine COFAC should be developed for cal-
culating the cofactor of the element at Ith row and Jth column of [A] in
term of the elements of [A] and the user-specified values of I and J. Let
the inverse of [A] be designated as [AI] and the determinant of [A] be
designated as D. Apply the developed program Invert3 to generate all
elements of [AI] by calling the subroutine COFAC and by using D.
3. Write a QuickBASIC or FORTRAN program MatxSorD which will
perform the addition and subtraction of two matrices of same order.
4. Write a QuickBASIC or FORTRAN program MxTransp which will
perform the transposition of a given matrix.
5. Translate the FORTRAN subroutine MatxMtpy into a MATLAB m file
so that by entering the matrices [A] and [B] of order L by M and M by
N, respectively, it will produce a product matrix [P] of order L by N.
6. Enter MATLAB commands interactively first a square matrix [A] and
then calculate its trace.
7. Use MATLAB commands to first define the elements in its upper right
corner including the diagonal, and then use the symmetric properties to
define those in the lower left corner.
8. Convert either QuickBasic or FORTRAN version of the program Matx-
InvD into a MATLAB function file MatxInvD.m with a leading statement
function [Cinv,D] = MatxInvD(C,N)
9. Apply the program MatxInvD to invert the matrix:
Verify the answer by using Equation 1.
10. Repeat Problem 9 but by MATLAB operation.
11. Apply the program MatxInvD to invert the matrix:
Verify the answer by using Equation 1.
12. Repeat Problem 11 but by MATLAB operations.
13. Derive [R
x
] and verify that it is indeed equal to [T
x
]
T
. Repeat for [R
y
] and
[R
z
].
14. Apply MATLAB to generate a matrix [R
z
] for θ
z
= 45° and then to use
[R
z
] to find the rotated coordinates of a point P whose coordinates before
rotation are (1,–2,5).
A
[]
=
13 4
56 7
8910
A
[]
=
−−−
−−−
−−−
912
345
678