Hello,
I struggle with the multiplication of two matrices. I cannot plot any result of the new matrix.
Sub Matrix()
Dim TableEK As Range
Dim Size As Integer
Dim x As Integer
Dim y As Integer
Dim ArrW As Variant
Dim ArrWs As Variant
Dim ArrC As Variant
Set TableEK = ActiveSheet.ListObjects("ek").Range.Cells(1, 1)
Size = 4
ReDim ArrW(1 To Size, 1 To 1)
ReDim ArrC(1 To 1, 1 To Size)
ReDim ArrWs(1 To Size, 1 To 1)
ArrW(1, 1) = 1
ArrW(2, 1) = 4
ArrW(3, 1) = 3
ArrW(4, 1) = 2
'MsgBox ArrW(1, 1)
'MsgBox ArrW(2, 1)
'MsgBox ArrW(3, 1)
'MsgBox ArrW(4, 1)
For x = 1 To Size
For y = 1 To Size
ArrC(1, y) = Cells(TableEK.Row + x, TableEK.Column - 1 + y)
Next
'MsgBox ArrC(1, 1)
'MsgBox ArrC(1, 2)
'MsgBox ArrC(1, 3)
'MsgBox ArrC(1, 4)
ArrWs(x, 1) = Application.WorksheetFunction.MMult(ArrC, ArrW)
MsgBox ArrWs(x, 1)
Next
End Sub
|