In order to label a simple 3x3 matrix, you can either do it by columns/rows or give it a full title over the whole matrix.
This is the code for both the full titles and by each column/row:
\begin{document}
\begingroup
\setlength{\tabcolsep}{2pt} % sets spacing horizontally
\renewcommand{\arraystretch}{1} % sets spacing vertically
\begin{tabular}{ c c c }
%===============================================================
%Row 1
%===============================================================
%Column 1
Top Title &
%Column 2
&
%Column 3
\\
%===============================================================
%Row 2
%===============================================================
%Column 1
%this creates the horizontal array
\begingroup %make sure to use this to control spacing separately from the bigger array
\setlength{\tabcolsep}{6pt}
\begin{tabular}{cccc}
1 & 2 & 3
\end{tabular}
\endgroup&
%Column 2
&
%Column 3
\\
%===============================================================
%Row 3
%===============================================================
% Column 1
$\begin{bmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{bmatrix}$ &
%Column 2
% this creates the vertical array
\begin{tabular}{ccc}
x \\ y \\ z
\end{tabular} &
%Column 3
Side Title
\end{tabular}
\endgroup
\end{document}

From this code you can adjust what titles you would like to keep/erase. Remember to adjust the matrix size accordingly. Matrices/tables/arrays have a syntax of:
Row1Column1 & Row1Column2 & ... & Row1Column(N) \\
Row2Column1 & Row2Column2 & ... & Row2Column(N) \\
.
.
.
Row(N)Column1 & Row(N)Column2 & ... & Row(N)Column(N)
So this is essentially a 3x3 matrix with the first column being:
- Big title (Top Title)
- column titles (1 2 3)
- matrix
Second Column:
- Empty space
- Empty space
- row titles (x y z)
Third Column:
- Empty space
- Empty space
- Big Title (Side title)