Kalman decomposition and closed-form computation of matrix functions via Jordan decomposition for control applications