MATRIX calculations with VBE

C

Cor Steeghs

I would appreciate help in the folowing :
I want to use VBE for assigning names to a ranges of cells
on a worksheet and execute matrix calculations like
MATR_B=MINVERSE(MATR_A)
MATR_C=MMULT(MATR_A;MATR_B)
What would the code look like?
Thanks for attending and/or reply,
best regards, Cor Steeghs
 
T

Tom Ogilvy

Sub demo1()
Dim varr As Variant, varr1 As Variant
varr = Evaluate("{1,2,1;3,4,-1;0,2,0}")
Range("A1:C3").Value = varr
varr1 = Evaluate("{1,2,3;4,5,6;3,2,5}")
Range("A10:C12").Value = varr
Range("A1:C3").Name = "Matr_A"
Range("A10:C12").Name = "Matr_B"
Range("D1:F3").Name = "Matr_C"
Range("D10:F12").Name = "Matr_D"
Range("Matr_C").Value = Application.MInverse(Range("Matr_A"))
Range("Matr_D").Value = Application.MMult(Range("Matr_A"), _
Range("Matr_B"))
End Sub


Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top