Row and column operations and matrix similarity Take for example the following matrix:
$$
A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}
$$
The elementary matrix equivalent to changing the first row with the second is
$$
E = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix} 
$$
multiplied from the left. The elementary matrix equivalent to changing the first column with the second is the same matrix $E$ multiplied from the right.
After a quick check, I found that $E = E^{-1}$.
Given that, I concluded that:
$$
B = \begin{pmatrix} 5 & 4 & 6 \\ 2 & 1 & 3 \\ 8 & 7 &9\end{pmatrix} = EAE^{-1}
$$
and therefore $A\sim B$.
Is this comprehensive? Does changing rows and column necessarily make the outcome similar to the original?
Thanks
 A: I hope I answer your question.
The matrix equivalent to changing rows following the permutation $\sigma$ is $P_{\sigma}$, the matrix of the permutation $\sigma$.
The matrix equivalent to changing columns following $\sigma$ is $P_{\sigma^{-1}}$.
Permutation matrix
You have $P_{\sigma}^{-1}=P_{\sigma}^{T}=P_{\sigma^{-1}}$
So if you have a matrix $A$, and $B$ is the outcome of changing the same rows and columns, you have $B=P_{\sigma}A P_{\sigma}^{-1}$ and $A\sim B$.
But if you don’t change the same rows and columns, you could have $B$ not similar to $A$ : take $A=I$, and $B=P_{\tau}A P_{\sigma}^{-1}$ with $\sigma=(1,2)$ and $\tau=(2,3)$. We have $tr(A)=n$ and $tr(B)=tr(P_{\sigma^{-1}\tau})=n-3$ then $A$ is not similar to $B$.
A: Yes, this is correct. If you change rows and columns with this same format, the outcome would be similar to the original. 
There is one typo in your $B$ though. The last row should be in the order of $\quad 8\quad 7\quad 9$.
A: 
The answer is NO. A counterexample is:


$\begin{pmatrix}0&1&0\\0&0&1\\1&0&0\end{pmatrix}$.

The answer is positive iff the permutation matrix $E$ satisfy $E=E^{-1}$ or $E^2=I$. So for the matrices of order other than two, the similarity condition ceases to hold.
