Substructing of two matrices