乳胶方程和 bmatrix

Latex Equation and bmatrix

我正在尝试使用官方方程式,但它给我带来了一些麻烦。我有一个简单矩阵运算的方程式,但 LaTeX 不喜欢它。这个说法有什么问题?

\begin{equation}
$M=\begin{bmatrix}
V_{1,1} & . & . & V_{1,n}\ 
. & . &  & \   
. &  &.  & \ 
 V_{m,1}&  &  & V_{m,n}
\end{bmatrix}$
\end{equation}

错误是: !显示数学应以 $$ 结尾。 米 l.186 $M =\begin{b矩阵} ? )

删除两个美元符号:

\begin{equation}
M=\begin{bmatrix}
V_{1,1} & . & . & V_{1,n}\ 
. & . &  & \   
. &  &.  & \ 
 V_{m,1}&  &  & V_{m,n}
\end{bmatrix}
\end{equation}

删除两个 $,您没有更多的错误。

然后,您可能想使用 LaTeX 提供的命令 \cdots\vdots\ddots(这三个命令甚至不需要包 amsmath,而环境 bmatrix):

需要它
\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
M=\begin{bmatrix}
V_{1,1} & \cdots & V_{1,n}\
\vdots & \ddots & \vdots\
V_{m,1} & \cdots & V_{m,n}
\end{bmatrix}
\end{equation}

\end{document}

产生

(编号equation)。请注意这是一个 3-x-3 矩阵,而不是 4-x-4。