I am reading the definition of almost diagonal matrix:
DEFINITION. A matrix $A$ is almost diagonal (a.d.) if there exist a diagonal matrix $D$ and vectors $x$ and $y$ such that $$A=D+xy^T$$ That is, $A$ is a.d. if it differs from a diagonal matrix by a matrix of rank one.
Why is $x y^T$ rank one?
Assuming $x, y$ are non zero column vectors in $K^n$ where $x=\begin{pmatrix}x_1\\x_2\\\vdots \\x_n\end{pmatrix}$ and $y=\begin{pmatrix}y_1\\y_2\\\vdots \\y_n\end{pmatrix}$
Then $y^T=\begin{pmatrix}y_1&y_2&\ldots &y_n\end{pmatrix}$
$\begin{align}xy^T&=\begin{pmatrix}x_1\\x_2\\\vdots \\x_n\end{pmatrix}\cdot\begin{pmatrix}y_1&y_2&\ldots &y_n\end{pmatrix}\\&=\begin{pmatrix}x_1y_1&x_1y_2&\ldots&x_1y_n\\x_2y_1&x_2y_2&\ldots &x_2y_n\\\vdots&\vdots&\dots&\vdots\\x_ny_1&x_ny_2&\ldots&x_ny_n \end{pmatrix} \end{align}$
Now use elimination to clean up all the rows below the first one. Hence the rank of $xy^T$ is $1$ .
If at least one $x$ or $y$ is the zero vector the $xy^T=\begin{pmatrix}0\end{pmatrix} _{n×n}$ whose rank is $0$.