答案1
解决方案如下blkarray
:
\documentclass[a4paper,12pt]{report}%
\usepackage[utf8]{inputenc}
\usepackage[english]{babel} %
\usepackage{amssymb, amsthm} %
\usepackage{mathtools, nccmath}
\usepackage{blkarray} %
\usepackage{bm} %
\begin{document}
\begin{align*}
\renewcommand\arraystretch{1.33}
& = \begin{blockarray}{[c]}
\rule{0pt}{14ex} \begin{blockarray}{*{7}{r}}
\begin{block}{|*{4}{r}|*{3}{r}}
\cline{1-4}
0 & 3 & -2 & 0 & 0 & 0 & 0 \\
0 & 1 & \mfrac{2}{3} & \mfrac{5}{3} & 0 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 & 0 & 0 \\
0 & 0 & \mfrac{2}{3} & \mfrac{5}{3} & 0 & 0 & 0 \\[1ex]
\end{block}
\hline
\begin{block}{*{4}{r}|*{3}{r}|}
0 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 \\
\cline{5-7}
\end{block}
\end{blockarray}
\end{blockarray}
-λ \begin{blockarray}{[c]}%
\rule{0pt}{13ex} \begin{blockarray}{*{7}{r}}
\begin{block}{|*{4}{r}|*{3}{r}}
\cline{1-4}
1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 \\
\end{block}%
\hline
\begin{block}{*{4}{r}|*{3}{r}|}
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\cline{5-7}
\end{block}
\end{blockarray}
\end{blockarray}\\
& =
\begin{bmatrix}
J & 0\\0 & I_{n₂}
\end{bmatrix}
-λ \begin{bmatrix}
I_{n₁} & 0\\0 & N
\end{bmatrix}
\end{align*}%
\end{document}