![创建一个矩阵,行和列在外面编号](https://linux22.com/image/418520/%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%9F%A9%E9%98%B5%EF%BC%8C%E8%A1%8C%E5%92%8C%E5%88%97%E5%9C%A8%E5%A4%96%E9%9D%A2%E7%BC%96%E5%8F%B7.png)
$$
\text{i: current-state}\Bigg\{\begin{matrix}0 \\ 1 \\ 2\end{matrix}\underbrace{\begin{bmatrix}P_{00} & P_{01} & P_{02} \\ P_{10} & P_{11} & P_{12} \\ P_{20} & P_{21} & P_{22}\end{bmatrix}}_{\text{j: next-state: 0, 1 ,2 }}
$$
创建行和列均有编号的矩阵的最佳方法是什么?
答案1
这是一个建议。
\documentclass{article}
\usepackage{array,amsmath}
\begin{document}
$\begin{array}{c@{}c}
\text{text} \left\{\begin{array}{c@{}}
0 \\ 1 \\ 2 \\
\end{array}\right.
& \left[\begin{array}{@{}*{3}{wc{5mm}}@{}}
$P_{00}$ & $P_{01}$ & $P_{02}$ \\
$P_{10}$ & $P_{11}$ & $P_{12}$ \\
$P_{20}$ & $P_{21}$ & $P_{22}$ \\
\end{array}\right]\\
&
\underbrace{\begin{array}{@{}*{3}{wc{5mm}}@{}}
0 & 1 & 2
\end{array}}_{\text{text}}
\end{array}$
\end{document}