Created
March 22, 2021 16:36
-
-
Save p-x9/dd76ec5ad10d9e2c65abb3b1fea0dc1f to your computer and use it in GitHub Desktop.
[VBA]行列の掛け算
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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