In this paper, we propose a necessary and sufficient condition for the solvability to a system of matrix equations over the commutative quaternion ring, and establish an expression of its general solution when it is solvable. We also present an algorithm for finding an approximate solution to the system when it is inconsistent. Finally, we give an example to illustrate the main results of this paper.