  Let $\mathbb{H}$ be the real quaternion algebra and $\mathbb{H}^{n\times m}$
denote the set of all $n\times m$ matrices over $\mathbb{H}$. In this paper, we
construct a simultaneous decomposition of seven general real quaternion
matrices with compatible sizes: $A\in \mathbb{H}^{m\times n}, B\in
\mathbb{H}^{m\times p_{1}},C\in \mathbb{H}^{m\times p_{2}},D\in
\mathbb{H}^{m\times p_{3}},E\in \mathbb{H}^{q_{1}\times n},F\in
\mathbb{H}^{q_{2}\times n},G\in \mathbb{H}^{q_{3}\times n}$. As applications of
the simultaneous matrix decomposition, we give solvability conditions, general
solutions, as well as the range of ranks of the general solutions to the
following two real quaternion matrix equations $BXE+CYF+DZG=A$ and
$BX+WE+CYF+DZG=A,$ where $A,B,C,D,E,F,$ and $G$ are given real quaternion
matrices.
