Question
For a square matrix, we will define Matrix Center to be the cell in that matrix where the summation of all its adjacent cells (
For a square matrix, we will define Matrix Center to be the cell in that matrix where the summation of all its adjacent cells ( ) is the maximal (). Complete the following subroutine which defines a 10x10 matrix and fills it with random values. The subroutine should determine the coordinates () of the Matrix Center; that is the (row, column) indices. Note that you can define any extra functions to simplify your code and increase its efficiency.
Sub FindMatrixCenter ()
Dim M(9, 9) As Double
Randomize()
For r = 0 To 9
For c = 0 To 9
M(r, c) = Rnd() * 100
Next c
Next r
.
.
End Sub
Step 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