Thread
:
Matrix Operations in VBA
View Single Post
#
2
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_]
external usenet poster
Posts: 414
Matrix Operations in VBA
For the MInverse try:
Dim vMtxA As Range, vMtxB As Variant
Set vMtxA = Range("B4:E7")
vMtxB = Application.WorksheetFunction.MInverse(vMtxA)
MsgBox vMtxB(1, 1)
Hope this helps
Rowan
wrote:
I would like to take the inverse of a matrix within my VBA code as part
of a sequence of operations. Something like the following:
Dim vMtxA As Variant, vMtxB As Variant, vMtxC() As Variant
vMtxA = Range("B4:E7")
vMtxB = Application.MInverse(vMtxA)
OR
ReDim vMtxC(4,4)
vMtxC = Application.MInverse(vMtxA)
I have not been able to find a way to do this. I would then multiply
the inverse by a RHS vector to get a solution vector that would be used
in subsequent calculations using MMult, etc. Also I have not figgured
out how to add two variant arrays??
vMtxD = vMtxA + vMtxB
Reply With Quote
Rowan Drummond[_3_]
View Public Profile
Find all posts by Rowan Drummond[_3_]