I have a 20 x 30 matrix in a two dimensional array. I have to do mathmatical operations on it where each element of the matrix is multiplied by the corresponding element in the next row. For example if it were a 3 x 4 matrix
2 3 5 1
7 5 8 2
1 4 8 2
The 2 would be multiplied by the 7 then the 3 by the 5.... After the first row is complete, the next row is multiplied to the third, 7 x 1 then
5 x 4 and so on. I cannot figure out what combinations of for loops will accomplish this task. Any help would be greatly appreciated.
2 3 5 1
7 5 8 2
1 4 8 2
The 2 would be multiplied by the 7 then the 3 by the 5.... After the first row is complete, the next row is multiplied to the third, 7 x 1 then
5 x 4 and so on. I cannot figure out what combinations of for loops will accomplish this task. Any help would be greatly appreciated.