This paper first studies the solution of a complex matrix equation X - AXB = C,obtains an explicit solution of the equation by means of characteristic polynomial, and then studies thequaternion matrix equation X - = C, characterizes the existence of a solution to the matrixequation, and derives closed-form solutions of the matrix equation in explicit forms by means of realrepresentations of quaternion matrices. This paper also gives an application to the complex matrixequation X - = C.