答案1
您可以使用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}