A criterion for generating full matrix algebras