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

Refresh to have a new matrix

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


The average of the first row is 3.25
The average of the second row is 3
The average of the third row is 4
The average of the fourth row is 6

The average of the first column is 7
The average of the second column is 3.25
The average of the third column is 1
The average of the fourth column is 5