Semigroups of finite matrices