-
I am writing a VBA function (of type Variant) to calculate the
inverse of an arbitrary 2*2 or 3*3 matrix in Excel. I am using the formula involving the adjoint
of the matrix. I need to have my function to flag unsuitable matrices (i.e., not 2 * 2 or 3 * 3) with a message box and then stop. To further clarify the adjoint of the matrix:
Step 1: calculating the Matrix of Minors,
Step 2: then turn that into the Matrix of Cofactors,
Step 3: then the Adjugate, and
Step 4: multiply that by 1/Determinant.
This is the code I have written so far but I am having a problem implementing the code to calculate the matrix cofactors and the matrix of minors. I am also not sure whether the code I have written for transpose and the determinant are correct. My main issue is figuring out how to successfully access the cell elements and multiply/add/subtract them. Thanks for any help in advance.
Bookmarks