In this paper, we proposed an algorithm for solving the linear systems of matrix equations
over the generalized
‐reflexive matrix
(
). According to the algorithm, the solvability of the problem can be determined automatically. When the problem is consistent over the generalized
‐reflexive matrix
, for any generalized
‐reflexive initial iterative matrices
, the generalized
‐reflexive solution can be obtained within finite iterative steps in the absence of roundoff errors. The unique least‐norm generalized
‐reflexive solution can also be derived when the appropriate initial iterative matrices are chosen. A sufficient and necessary condition for which the linear systems of matrix equations is inconsistent is given. Furthermore, the optimal approximate solution for a group of given matrices
can be derived by finding the least‐norm generalized
‐reflexive solution of a new corresponding linear system of matrix equations. Finally, we present a numerical example to verify the theoretical results of this paper.