## How to write a diagonal matrix in LaTeX?

Elements of the diagonal matrix will be along the diagonal. All the other positions except the diagonal position of the matrix will be filled by zero. \documentclass{article} \usepackage{amsmath} \begin{document} \[ …