This paper is a matrix iterative method presented to compute the solutions of the matrix equation, AXB=C, with unknown matrix X∈𝒮, where 𝒮 is the constrained matrices set like symmetric, symmetric-R-symmetric and (R, S)-symmetric. By this iterative method, for any initial matrix X 0∈𝒮, a solution X* can be obtained within finite iteration steps if exact arithmetics were used, and the solution X* with the minimum Frobenius norm can be obtained by choosing a special kind of initial matrix. The solution , which is nearest to a given matrix ˜X in Frobenius norm, can be obtained by first finding the minimum Frobenius norm solution of a new compatible matrix equation. The numerical examples given here show that the iterative method proposed in this paper has faster convergence and higher accuracy than the iterative methods proposed in [G.-X. Huang, F. Yin, and K. Guo, An iterative method for the skew-symmetric solution and the optimal approximate solution of the matrix equation AXB=C , J. Comput. Appl. Math. 212 (2008), pp. 231–244; Y. Lei and A.-P. Liao, A minimal residual algorithm for the inconsistent matrix equation AXB=C over symmetric matrices, Appl. Math. Comput. 188 (2007), pp. 499–513; Z.-Y. Peng, An iterative method for the least squares symmetric solution of the linear matrix equation AXB=C , Appl. Math. Comput. 170 (2005), pp. 711–723; Y.-X. Peng, X.-Y. Hu, and L. Zhang, An iteration method for the symmetric solutions and the optimal approximation solution of the matrix equation AXB=C , Appl. Math. Comput. 160 (2005), pp. 763–777].