# Math Help - Similarity matrices

1. ## Similarity matrices

Let A, B are matrices such that $A^2=A,\quad B^2=B$. Prove that A, B are similar if and only if $rank A= rank B$.
$A = (UBU^{-1})$