  We prove that the following statements are equivalent: a linear matrix
equation with parameters forming a commuting set of diagonalizable matrices is
consistent, a certain matrix constructed with the Drazin inverse is a solution
of this matrix equation, the attached standard linear matrix equation is
consistent. The number of zero components of a given matrix (the relevant
matrix) gives us the dimension of the affine space of solutions. We apply this
theoretical results to the Sylvester equation, the Stein equation, and the
Lyapunov equation. We present a description of the set of the diagonalizing
matrices for a commuting sequence of diagonalizable matrices.
