Home / Expert Answers / Computer Science / how-to-use-vba-customize-function-to-solve-matrix-multiplication-by-using-ubound-use-loops-to-crea-pa733

(Solved): how to use VBA customize function to solve matrix multiplication by using ubound Use loops to crea ...



how to use VBA customize function to solve matrix multiplication by using ubound Use loops to create a matrix multiplication.
Sub vecMatMult()
Function MyMatMult(vec, mat)
Rnd is a random draw from 0 to 1

Use loops to create a matrix multiplication. Sub vecMatMult() Function MyMatMult(vec, mat) 'Rnd is a random draw from 0 to 1 ' Round Rnd ' '> ' As Integer ReDim vec(m) As Integer ubound(vec, 1) redim out(n) as double For To MyMatMult Return the answer, not For To End Function Next j Next i ' Notice the use of ubound to discover the size of the vector. 'Notice the use of ubound to discover ths size of the matrix. For To Next i out = MyMatMult(vec, mat) End Sub


We have an Answer from Expert

View Expert Answer

Expert Answer


Sub vecMatMult() Dim m As Integer, n As Integer Dim mat(1 To 5, 1 To 5) As Integer Dim vec(1 To 5) As Integer Dim out(1 To 5) As Double m = 5
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe