这里给出几个用 LaTeX 形式描述的矩阵示例:
1. 基础矩阵
latex
\begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}效果:
2. 带有竖线分隔的行增广矩阵(用于线性方程组)
latex
\left[\begin{array}{ccc|c} 1 & 2 & 3 & 6 \\ 4 & 5 & 6 & 15 \\ 7 & 8 & 9 & 24 \end{array}\right]效果:
3. 对角矩阵
latex
\begin{bmatrix} \lambda_1 & 0 & 0 \\ 0 & \lambda_2 & 0 \\ 0 & 0 & \lambda_3 \end{bmatrix}效果:
4. 稀疏矩阵(含省略号)
latex
\begin{pmatrix} 1 & 0 & 0 & \cdots & 0 \\ 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & 1 \end{pmatrix}效果:
5. 块矩阵(分块矩阵)
latex
A = \begin{bmatrix} A_{11} & A_{12} & \cdots & A_{1n} \\ A_{21} & A_{22} & \cdots & A_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ A_{m1} & A_{m2} & \cdots & A_{mn} \end{bmatrix}效果:
6. 雅可比矩阵(函数矩阵)
latex
J_f(x) = \begin{bmatrix} \dfrac{\partial f_1}{\partial x_1} & \dfrac{\partial f_1}{\partial x_2} & \cdots & \dfrac{\partial f_1}{\partial x_n} \\[8pt] \dfrac{\partial f_2}{\partial x_1} & \dfrac{\partial f_2}{\partial x_2} & \cdots & \dfrac{\partial f_2}{\partial x_n} \\[8pt] \vdots & \vdots & \ddots & \vdots \\[8pt] \dfrac{\partial f_m}{\partial x_1} & \dfrac{\partial f_m}{\partial x_2} & \cdots & \dfrac{\partial f_m}{\partial x_n} \end{bmatrix}效果:
常用矩阵环境对比
| 环境 | 分隔符 | 说明 |
|---|---|---|
matrix | 无 | 纯矩阵 |
pmatrix | ( ) | 圆括号 |
bmatrix | [ ] | 方括号 |
Bmatrix | { } | 花括号 |
vmatrix | | | | 行列式竖线 |
Vmatrix | | | | 范数双竖线 |
array | 自定义 | 最灵活,可定义列对齐方式 |
完整示例(包含在文档中)
latex
\documentclass{article} \usepackage{amsmath} \begin{document} Let $A$ be a $3 \times 3$ matrix: \[ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix} \] The determinant of $A$ is \\ \[ \det(A) = \begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{vmatrix} \] \end{document}效果:
这些示例涵盖了 LaTeX 中描述矩阵的基本和常用形式。您可以根据需要选择合适的环境和格式。