How can I obtain the generic matrix T such that $\hat{X}=TX$ with:

$$\hat{X}=\left[\begin{array}{cc}a& 0\\ 0& b\\ c& 0\\ 0& d\end{array}\right]$$

and

$$X=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$$

I did several try without obtaining the result I needed.

$$\hat{X}=\left[\begin{array}{cc}a& 0\\ 0& b\\ c& 0\\ 0& d\end{array}\right]$$

and

$$X=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$$

I did several try without obtaining the result I needed.