# vector to diagonal matrix [closed]

For any column vector we can easily create a corresponding diagonal matrix, whose elements along the diagonal are the elements of the column vector.

Is there a simple way to write this transformation using standard linear algebra operations (such as matrix multiplication, etc.), instead of explicitly writing it as $diag(\mathbf{x})$?

For example $M \mathbf{x}$ cannot work for any matrix M, since the result will be a vector, not a diagonal matrix. But maybe there is some more elaborate expression that yields the diagonal matrix.

• I have worried about this, and think the answer is basically no, largely because a column vector is rank 1 and the diagonal matrix is larger rank. But I wouldn't say that's a proof. Feb 18, 2011 at 4:11
• When you say "notation", do you mean "method"? Feb 18, 2011 at 4:17
• Well you can hardly call it a method, it doesn't really do any multiplications, its basically just writing it in a way that implies its shape. Feb 18, 2011 at 4:22
• notation-wise that's $diag({\bf x})$. proof-wise, however, I agree with the first comment, you jump from a $1$-dimensional space to an $n$-dimensional space, so no linear operator can get you there. From the diagonal you can definitely go to the vector. Just multiply it with the all ones vector. Feb 18, 2011 at 4:34
• I think this question should be improved before it is appropriate for MO. As is, I have voted to close, but I hope that instead OP rewrites it to clarify (you can modify the question by clicking the little "edit" button). Please see mathoverflow.net/howtoask . Feb 18, 2011 at 5:14

I'm not sure whether it answers your question, but here is a "matrix procedure" to transform the column vector $v$ into a diagonal matrix $D$:
Let $E_i$ be the $n \times n$ matrix with a $1$ on position $(i,i)$ and zeros everywhere else; similarly, let $e_i$ be the $1 \times n$ row matrix with a $1$ on position $(1,i)$ and zeros everywhere else. Then
$$D = \sum_{i=1}^n E_i v e_i .$$