  We estimate the frequency of singular matrices and of matrices of a given
rank whose entries are parametrised by arbitrary polynomials over the integers
and modulo a prime $p$. In particular, in the integer case, we improve a recent
bound of V. Blomer and J. Li (2022).
