0

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

Bernard
  • 271,350
  • 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. – Johannes_B Nov 15 '19 at 05: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} – Bidisha Bhabani Nov 15 '19 at 05:35
  • I am unable o write the left side Es and the upper side Es. Please suggest. – Bidisha Bhabani Nov 15 '19 at 05: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} `

    –  Nov 15 '19 at 05:40
  • It worked. Thanks Schrödinger's cat. – Bidisha Bhabani Nov 15 '19 at 05:46
  • This has been asked many times: https://tex.stackexchange.com/search?q=bordermatrix – Henri Menke Nov 15 '19 at 06:06

1 Answers1

2

You can use nicematrix:

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
$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}$
\end{document}

enter image description here

F. Pantigny
  • 40,250