The solution of the generalized Sylvester real matrix equation XB−AX=CY is important in stability analysis and controller design in linear systems. This paper presents an explicit solution to the generalized Sylvester real matrix equation XB−AX=CY. Based on the derived explicit solution to the considered generalized Sylvester real matrix equation, a new approach is provided for obtaining the solutions to the generalized Sylvester quaternion j-conjugate matrix equation View the MathML source using the real representation of a quaternion matrix. The closed form solution is established in an explicit form for this generalized Sylvester quaternion j-conjugate matrix equation. The existing complex representation method requires the coefficient matrix A to be a block diagonal matrix over complex field, while it is any suitable dimension quaternion matrix in the present paper. Therefore, we generalize the existing results.