Subalgebras of rational matrix algebras