# How to display the following matrix in texmaker? [duplicate]

I want to display the following matrix in texmaker. please suggest.

• Welcome o TeX.sx. It has nothing to do with TeXmaker. It is just an editor. Have you read an introduction to LaTeX? It is all about Math mode. Nov 15, 2019 at 5:33
• yes, I am able to write the matrix part but unable to write that Es. PM = \begin{pmatrix} \alpha_{11} & \alpha_{12} & ... & \alpha_{1M} \\ \alpha_{21} & \alpha_{22} & ... & \alpha_{2M} \\ . & . &. &. \\ . & . &. &. \\ . & . &. &. \\ \alpha_{M1} & \alpha_{M2} & ... & \alpha_{MM} \end{pmatrix} Nov 15, 2019 at 5:35
• I am unable o write the left side Es and the upper side Es. Please suggest. Nov 15, 2019 at 5:38
• Use blkarray: \documentclass{article} \usepackage{blkarray} \begin{document} $PM= \begin{blockarray}{ccccc} & E_1 & E_2 & \cdots & E_M\\ \begin{block}{c(cccc)} E_1 & \alpha_{11} & \alpha_{12} & \cdots & \alpha_{1M}\\ E_2 & \alpha_{21} &\alpha_{22} & \cdots & \alpha_{2M}\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ E_M & \alpha_{M1} & \alpha_{M2} & \cdots & \alpha_{MM}\\ \end{block} \end{blockarray}$ \end{document}
– user194703
Nov 15, 2019 at 5:40
• It worked. Thanks Schrödinger's cat. Nov 15, 2019 at 5:46

You can use nicematrix:
\documentclass{article}
$PM = \begin{pNiceMatrix}[first-row,first-col] & E_1 & E_2 & \Cdots & E_M \\ E_1 & \alpha_{11} & \alpha_{12} & \Cdots & \alpha_{1M} \\ E_2 & \alpha_{12} & \alpha_{22} & \Cdots & \alpha_{2M} \\ \Vdots & \Vdots & \Vdots & \Ddots & \Vdots \\ E_M & \alpha_{M_1} & \alpha_{M2} & \Cdots & \alpha_{MM} \end{pNiceMatrix}$