I think that you want to modify matrix_c in-place:
matrix_c
matrix_c /= (N * M)
Or probably less effective:
matrix_c = matrix_c / (N * M)
Expression matrix_c / (N * M) doesn't change matrix_c - it creates a new matrix.
matrix_c / (N * M)
Another solution would be to use numpy.divide
numpy.divide
matric_c = np.divide(matrix_c, N*M)
Just make sure N*M is a float in case your looking for precision.