Add EchecEtMat function and test.