The authors establish the maximal and minimal ranks of the solution to the consistent system of quaternion matrix equations
, recently investigated by Q. W. Wang
[Comput. Math. Appl. 49, 665–675 (2005; Zbl 1138.15004
)]. As an application, a necessary and sufficient condition for the invariance of the rank of the general solution to the system mentioned above is presented.