Explicit expressions for the entries of the inverse of a general diagonal matrix are derived via the decomposition approach. In particular, three-term recurrence relations with variable coefficients are given, and with their solutions closed form expressions for each entry of the fundamental matrix of a Markov chain-random walk (MC-RW) model are established. We also obtain explicit formulas for the absorption probabilities and the mean time to absorption as well as the mean number of steps before absorption of the MC-RW model in the presence of two semiabsorbing boundaries.