I am trying to solve an engineering problem using matrices. I know some programming in VBA but not alot, this problem has puzzled me for quite a while. So any idea will be much appreciated.
Each of [4 x 4] matrix is generated based on the parameters of the equation, but for the purpose of easy illustration and simplicity, let's presume that the 1st matrix is filled with number 1's, 2nd with number 2's, and so on. The top left quadrant of the latter matrix is always adds to the bottom right quadrant of the previous matrix (as per photo shown below). So when a [4 x 4] matrix + [4 x 4] matrix, it forms a super matrix of [6 x 6] with the new value from previous addition, if there are no values, zero will be put in to complete the dynamic super matrix. This matrix will grow when more [4 x 4] matrices is added.
My question how can I achieve this with VBA coding? I looked up using 2 nested For loop for simple addtion of matrices (row 1, col 1 gets to add to row 1, col 1, etc..), but it not my case. I though about to generate the super matrix filled zero's first, then each of the next [4 x 4] is added into the super matrix. But the tricky part is how to offset each of the next matrix by 2 rows and 2 cols. Please help me with this one, thanks in advance for the great brains!!
Each of [4 x 4] matrix is generated based on the parameters of the equation, but for the purpose of easy illustration and simplicity, let's presume that the 1st matrix is filled with number 1's, 2nd with number 2's, and so on. The top left quadrant of the latter matrix is always adds to the bottom right quadrant of the previous matrix (as per photo shown below). So when a [4 x 4] matrix + [4 x 4] matrix, it forms a super matrix of [6 x 6] with the new value from previous addition, if there are no values, zero will be put in to complete the dynamic super matrix. This matrix will grow when more [4 x 4] matrices is added.
My question how can I achieve this with VBA coding? I looked up using 2 nested For loop for simple addtion of matrices (row 1, col 1 gets to add to row 1, col 1, etc..), but it not my case. I though about to generate the super matrix filled zero's first, then each of the next [4 x 4] is added into the super matrix. But the tricky part is how to offset each of the next matrix by 2 rows and 2 cols. Please help me with this one, thanks in advance for the great brains!!