I'd like to decompose a matrix M into a diagonal matrix D and an orthogonal matrix Q, such that
$$ \begin{bmatrix} d_1 & 0 & 0 \\ 0& d_2 & 0\\ 0 & 0 & d_3 \\ \end{bmatrix} \cdot \begin{bmatrix} q_1 & q_2 & q_3 \\ q_4 & q_5 & q_6\\ q_7 & q_8 & q_9 \\ \end{bmatrix} = \begin{bmatrix} m_1 & m_2 & m_3 \\ m_4 & m_5 & m_6\\ m_7 & m_8 & m_9 \\ \end{bmatrix} $$
Does somebody know, if there exists such a decomposition?
I'm using this to split a matrix into a projection matrix and a rotation matrix. This is usually done with the RQ-Decomposition (Upper-Triangle * Orthogonal). But in my case, I want the projection matrix to be a 'trivial' diagonal matrix.
Thanks for your help.
Normalise every nonzero row of $M$ to obtain a matrix $Q_1$. The desired decomposition is possible if and only if all nonzero rows of $Q_1$ are orthogonal to each other.