Here is a 4X4 matrix randomly generated and between 0 and 9 :

Refresh to have a new matrix

6 5 5 6
4 3 7 9
7 1 9 8
7 7 4 2


The average of the first row is 5.5
The average of the second row is 5.75
The average of the third row is 6.25
The average of the fourth row is 5

The average of the first column is 6
The average of the second column is 4
The average of the third column is 6.25
The average of the fourth column is 6.25