  In this paper, we construct a simultaneous decomposition of five real
quaternion matrices in which three of them have the same column numbers,
meanwhile three of them have the same row numbers. Using the simultaneous
matrix decomposition, we derive the maximal and minimal ranks of some real
quaternion matrices expressions. We also show how to choose the variable real
quaternion matrices such that the real quaternion matrix expressions achieve
their maximal and minimal ranks. As an application, we give a solvability
condition and the general solution to the real quaternion matrix equation
$BXD+CYE=A$. Moreover, we give a simultaneous decomposition of seven real
quaternion matrices.
