On the codimension of subalgebras of the algebra of matrices over a field