Find the variance of a matrix