Generalized matrix Pade approximants