Skip to content

Instantly share code, notes, and snippets.

@p-x9
Created March 22, 2021 16:36
Show Gist options
  • Save p-x9/dd76ec5ad10d9e2c65abb3b1fea0dc1f to your computer and use it in GitHub Desktop.
Save p-x9/dd76ec5ad10d9e2c65abb3b1fea0dc1f to your computer and use it in GitHub Desktop.
[VBA]行列の掛け算
Function multiplication(a, x)
Dim ans() As Double
ReDim ans(UBound(a), UBound(x, 2))
For i = 1 To UBound(a)
For j = 1 To UBound(x, 2)
ans(i, j) = 0
For k = 1 To UBound(a, 2)
ans(i, j) = ans(i, j) + a(i, k) * x(k, j)
Next
Next j
Next i
multiplication = ans()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment