Public FunctionTest(a() As Byte, b() As Byte) As Variant

Dim i As Integer

Dim c() As Integer

ReDim c(UBound(a, 1), UBound(b, 1))

For i = 0 To UBound(a, 1)

’代碼自行添加

Next i

Test = c
End Function
Public Function iMUL(a() As Integer, b() As Integer) As Variant
Dim i, j, k As Integer
If UBound(a, 2) <> UBound(b, 1) Then
MsgBox "參數錯誤,請輸入兩個可以相乘的矩陣!"
End
End If
ReDim c(UBound(a, 1), UBound(b, 2))
For k = 0 To UBound(b, 2)
c(i, k) = 0
For j = 0 To UBound(a, 2)
c(i, k) = c(i, k) + a(i, j) * b(j, k)
Next j
Next k
iMUL = c