|
Option Explicit
Const line As Integer = 11
Const row As Integer = 21
Const gyou As Integer = 21
Const retu As Integer = 1
Dim A(line, row) As Double
Dim B(gyou, retu) As Double
Sub Mondai()
Call Worksheets("sheet6").Activate
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim sum As Double
Dim l As Integer
For i = 1 To line
For j = 1 To row
A(i, j) = Cells(i, j)
Next j
Next i
For k = 1 To gyou
For l = 1 To retu
B(k, l) = Cells(k, l + line + 1)
Next l
Next k
For i = 1 To line
For j = 1 To row
sum = 0
For k = 1 To gyou
sum = sum + A(i, k) * B(k, j)
Next k
Cells(i + line + 1, row + j + 11) = sum
Next j
Next i
End Sub
11*21と21*1の行列の掛け算を求めたいのですがどこが違うか正してください。
|
|