[Tex/LaTex] How to draw matrix with dots

matrices

How can I draw a matrix with dots in tex like the one shown below:

matrix

Best Answer

I suggest you load the amsmath package, employ its the bmatrix ("bracketed matrix") environment, and use \dots (or \ldots), \vdots ("vertical dots"), and \ddots ("diagonal dots") as needed.

The following screenshot shows two ways this approach could be employed. The first replicates the matrix shown in the OP's posting. The second shows that this method can be used for square as well as non-square matrices.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'bmatrix' environment
\begin{document}
\[
A = \begin{bmatrix} 
    a_{11} & a_{12} & \dots \\
    \vdots & \ddots & \\
    a_{K1} &        & a_{KK} 
    \end{bmatrix}
\qquad
B = \begin{bmatrix} 
    b_{11} & \dots  & b_{1M}\\
    \vdots & \ddots & \vdots\\
    b_{K1} & \dots  & b_{KM} 
    \end{bmatrix}
\]
\end{document}
Related Question