# Example of 2 matrices similar but not row equivalent

If two matrices are row equivalent, they may not be similar because all invertible matrices are row equivalent to $$I$$, yet not all invertible matrices have the same trace, eigenvalues etc.

Is it also true that if two matrices are similar, they may not be row equivalent? My instinct is that there is no reason that 2 similar matrices need to be row equivalent since having the same rank, eigenvalues, determinant etc does not necessarily make them row equivalent.

Any suggestions as to how to find a counter-example?

Thanks for help.

Consider all $$n\times n$$ diagonal matrices whose diagonal entries are $$n$$ distinct fixed numbers $$d_1,d_2,\ldots, d_n$$. (there are $$n!$$ of them). Assume these numbers to be non-zero. Then it is easy to see that they are all similar to each other. (Use permutation matrices as done in the answer of Siong Thye Goh).
But these matrices are not row equivalent: two row equivalent matrices will lead to systems of linear equations with identical solutions. Let RHS vector be $$v=(1,2,\ldots, n)^T$$.
The system $$DX= v$$ and $$D'X=v$$ will not not have same solution for $$D,D'$$ diagonal matrices satisfying the conditions above.
$$\begin{bmatrix} 0 & 1 \\ 1 & 0\end{bmatrix}\begin{bmatrix} 0 & 1 \\ 0 & 0\end{bmatrix}\begin{bmatrix} 0 & 1 \\ 1 & 0\end{bmatrix}=\begin{bmatrix} 0 & 0 \\ 1 & 0\end{bmatrix}$$
$$\begin{bmatrix} 0 & 1 \\ 0 & 0\end{bmatrix}$$ and $$\begin{bmatrix} 0 & 0 \\ 1 & 0\end{bmatrix}$$ are not row equivalent though they are similar.