Notation for matrix filled with zeros except for one row and one column

926 Views Asked by At

Is there existing succinct notation for a matrix $[A]_i$ whose elements are all $0$, except that the $i$th row and $i$th column is given by a particular vector, for example the vector

$$\mathbf{z} = \frac{\mathbf{v} - 2\mathbf{v}_i}{a}$$

I'm trying to avoid having to put in something like

$$ [A]_i = \begin{bmatrix} 0 & \ldots & \dfrac{\mathbf{v}_1 - 2\mathbf{v}_i}{a} & 0 & \ldots & 0 \\ \vdots & \ddots & \dfrac{\mathbf{v}_2 - 2\mathbf{v}_i}{a} & 0 & \ldots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ \dfrac{\mathbf{v}_1 - 2\mathbf{v}_i}{a} & \dfrac{\mathbf{v}_2 - 2\mathbf{v}_i}{a} & \ldots & \ldots & \ldots & \dfrac{\mathbf{v}_n - 2\mathbf{v}_i}{a} \\ 0 & \ldots & \dfrac{\mathbf{v}_{i+1} - 2\mathbf{v}_i}{a} & 0 & \ldots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ \end{bmatrix} $$

2

There are 2 best solutions below

1
On BEST ANSWER

If ${\bf e_i}$ is the column vector with $1$ in position $i$ and $0$ elsewhere, this is ${\bf z} {\bf e_i}^\top + {\bf e_i} {\bf z}^\top - z_i {\bf e_i} {\bf e_i}^\top$.

0
On

$$M_{y, x}= \begin{cases} x = i & \dfrac{v_y - 2v_i}a \\ y = i & \dfrac{v_x - 2v_i}a \\ \text{else} & 0 \\ \end{cases}$$

Is another (IMO more readable) alternative.