Matrix problems and Drozd's theorem