Polynomial Detection of Matrix Subalgebras