0
$\begingroup$

Consider having vector

$v = \begin{pmatrix} v_1\\ v_2\\ \vdots\\ v_n \end{pmatrix}$

Consider the final result:

$ V = \begin{pmatrix} v_1 & 0 & \dots & 0\\ 0 & v_2 & \dots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \dots & v_n\\ \end{pmatrix} $

How to get matrix $V$ operating on $v$ with matricial operations?

Thanks

  • 0
    I mean just products and sums...2012-05-15

1 Answers 1

1

You can see that the basis vectors must be involved in this conversion, because the result depends on the basis we use. For example, $v=(1,\dots,1)^T$ will produce the identity matrix, but not if we operate in a different basis. This is why there cannot be a natural coordinate-free transformation of $v$ into $V$.

In the formula given by martini, $V=\sum_{i=1}^n (v^T e_i)(e_ie_i^T)$, the product $e_ie_i^T$ is the matrix with $(i,i)$ entry $1$ and other entries $0$. Multiplication by the scalar $v^T e_i = v_i$ turns $1$ into $v_i$. Summation over $i$ completes the construction.

By the way, Matlab has built-in diag(v) for this purpose.