The primary decomposition of a set of matrices