The Yang–Baxter–like matrix equation plays an important role in quantum group theory, knot theory and braid groups, which has received great attention from physicists and mathematicians. A difficult and important open problem is to find all the solutions of the Yang–Baxter–like matrix equation. As a matter of fact, it is difficult to find all of the solutions even when the coefficient matrix is a matrix. To the best of our knowledge, when the coefficient matrix is a diagonalizable complex matrix with three distinct nonzero eigenvalues, finding all the solutions of the Yang–Baxter–like matrix equation is still an open problem. In order to fill-in this gap, we first present a sufficient and necessary condition for the commuting solutions of the Yang–Baxter–like matrix equation, and give all the commuting solutions of the matrix equation. Second, with the help of a simplified matrix equation, we derive all the non–commuting solutions of the Yang–Baxter–like matrix equation by discussing whether the off–diagonal elements of the solutions are zero or not.