On the use of matrix functions for fractional partial differential equations