Convergence of inhomogenous products of matrices and coefficients of ergodicity