Follow-on question on similar matrices For square diagonal $L$ and $M$, and invertible $A$ and $B$, if
$$X = A  L  A^{-1},$$ and $$Y = B  M B^{-1}$$
are equal ($X=Y$), is there a way to express $A$ explicitly in terms of $B$, $L$, $M$?
Seems easy enough; brain is just not working today...
(P.S. Thanks for answers on earlier question on this problem!)
 A: Since $L$ and $M$ are each diagonalizations of the same matrix $X=Y$, we know that $L$ and $M$ have the same diagonal entries.  That is, there is some permutation matrix $P$ such that $L = P M P^{-1}$.  Thus, the first equality becomes
$$
X = APMP^{-1}A^{-1} = (AP)M(AP)^{-1} = Y = BMB^{-1}
$$
That is, $B=AP$ for some permutation matrix $P$.
A: If $A$ and $B$ are rectangular, then they can't possibly have inverses, so the premise doesn't hold. However, assuming that $A$ and $B$ were square, then:
$X = ALA^{-1} = BMB^{-1} = Y$ is what we're working with.
Then, 
$ALA^{-1} = BMB^{-1}$
$ALA^{-1}A = AL = BMB^{-1}A$
$ALL^{-1} = A = BMB^{-1}AL^{-1}$ This only works if all the elements on the diagonal are non-zero. If so, then $L$ is invertible.
$A = BMB^{-1}AL^{-1}$, which is the closest you're going to get. Again, this assumes that that $A$ and $B$ are both square, because they can't have inverses if they're rectangular, and $L$ must be non-zero for every diagonal entry.  
Granted, this isn't explicit, but I believe it is the closest you will get. 
