Generalized matrix functions