Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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 ' m= Round ( Rnd 5,0)+1 ' n=Round(Rnd5,0)+1 '> ' ReDimmat(m,n) As Integer ReDim vec(m) As Integer n= ubound(vec, 1) redim out(n) as double For i=0 To m MyMatMult =0 For j=0 To n mat(i,j)=i3+j+1 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 i=0 To m vec(i)=i+1 Next i out = MyMatMult(vec, mat) End SubStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started