I am trying to produce an nxn bmatrix
that has both column and row headings. By following this manual with amsmath package
and the code below:
\begin{figure}
\[\begin{bmatrix}
a_{11}&a_{12}&\cdots &a_{1n} \\
a_{21}&a_{22}&\cdots &a_{2n} \\
\vdots & \vdots & \ddots & \vdots\\
a_{n1}&a_{n2}&\cdots &a_{nn}
\end{bmatrix}\]
\caption{Correlation Matrix}\label{fig:vulnmatrix}
\end{figure}
I can produce this:
However, I aim at producing a bmatrix with column and row headings like this:
So far I have researched and all the examples I have encountered do not have headings. Can anyone suggest a solution for me?
blkarray
is your friend. similar question was asked many times here.