答案1
您可以使用\bordermatrix
。
\documentclass{article}
\begin{document}
\[
\bordermatrix{
& f(e_1) & \dots & f(e_j) & \dots & f(e_p) \cr
f_1 & a_{1,1} & & a_{1,j} & \dots & a_{1,p} \cr
f_2 & a_{2,1} & & a_{2,j} & \dots & a_{2,p} \cr
\vdots & \vdots & & \vdots & \ddots & \vdots \cr
f_n & a_{n,1} & \dots & a_{n,j} & \dots & a_{n,p} \cr
}
\]
\end{document}
答案2
基于以下的解决方案gauss
:
\documentclass{article}
\usepackage[x11names]{xcolor}
\usepackage{mathtools}
\usepackage{gauss, array, pgffor}
\def\matlab{\mult}
\newenvironment{annotmatrix}[1][]{%
\let\rowmultlabel\text \let\colmultlabel\text\setlength{\rowarrowsep}{0pt}\setlength{\colarrowsep}{0.8ex}%
\gmatrix[#1]}
{\endgmatrix}
\begin{document}
\[\renewcommand\arraystretch{1.3}
\begin{tabular}{ >{\footnotesize\color{PaleGreen3}$}c<{\!$}@{}}
f_1 \\[-0.8ex] f_2 \\ \vdots\\[-0.1ex] f_n
\end{tabular}
\begin{annotmatrix}[p]%
a_{11} & \dots & a_{1j} & \dots &a_{1p} \\%
a_{21} & \dots & a_{2j} & \dots &a_{2p} \\%
\vdots & & \vdots & &\vdots \\%
a_{n1} & \dots & a_{nj} & \dots &a_{np}
\colops
\foreach \i/\label in {0/ f({\color{RoyalBlue3}e_1}), 1/\dotsm, 2/ f({\color{RoyalBlue3}e_j}), 3/\dotsm, 4/ f({\color{RoyalBlue3}e_p})}{\matlab{\i}{\footnotesize$ \label$}}
\end{annotmatrix}
\]
\end{document}