Relating to all $n\times n$ matrices $(A)$ with the property $a_{i,j}=0$ if $|j-i|>1$
A diagonal matrix is an $n\times n$ matrix $A$ with $a_{i,j}=0$ if $i\neq j$; that is, the only possible nonzero entries are on the diagonal, where $i=j$. A tridiagonal matrix is a generalization that allows for non-zero entries directly above or below this diagonal, i.e. where $i-j = -1,0,1$. The diagonal $a_{i,j}$, $i-j=1$ is directly below the main diagonal and is known as the sub-diagonal; likewise, the diagonal $a_{i,j}$, $i-j=-1$ is known as the super-diagonal.
One common application is in difference equations such as the finite element method, where this condition models input from a cell and its neighbors. A special type of tridiagonal matrix is a Toeplitz matrix, where the off-diagonal elements are constants; see toeplitz-matrices for more information. Tridiagonal matrices are themselves a special case of band matrices, where only a finite number of diagonals are non-zero.