You can do it with blkarray
. A couple of dummy columns are necessary for accommodating the horizontal rules.
\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray}
\begin{document}
\[
\renewcommand\arraystretch{1.3}
\begin{blockarray}{rcccccccc}
&&& u & v & w & \rho & T & \\
&&& \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \\
\begin{block}{rc[c@{}c|c|c|c|c@{}c]}
\text{Cont.} & \to && A_{c,u} & A_{c,v} & A_{c,w} & A_{c,\rho} & A_{c,T} &\vphantom{\smash[b]{\bigg|}} \\
\BAhhline{~~~-----~}
x\text{-mom} & \to && A_{r,\rho} & A_{r,u_r} & A_{r,u_{\theta}} & A_{r,u_z} & A_{r,T} & \\
\BAhhline{~~~-----~}
A_{ij}=\quad
y\text{-mom} & \to && A_{\theta,\rho} & A_{\theta,u_r} & A_{\theta,u_{\theta}} & A_{\theta,u_z} & A_{u_{\theta},T} & \\
\BAhhline{~~~-----~}
z\text{-mom} & \to && A_{z,\rho} & A_{z,u_r} & A_{z,u_{\theta}} & A_{z,u_z} & A_{z,T} & \\
\BAhhline{~~~-----~}
\text{energy} & \to && A_{e,\rho} & A_{e,u_r} & A_{e,u_{\theta}} & A_{e,u_z} & A_{e,T} & \vphantom{\smash[t]{\bigg|}}\\
\end{block}
\end{blockarray}
\]
\end{document}
The \vphantom
trick is for getting slightly bigger brackets.

With blkarray
it is possible:
\documentclass{article}
\usepackage{amsmath,blkarray,booktabs}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\fixhd}[1]{%
\smash[#1]{\vphantom{\Big|}}%
}
\begin{document}
\[
\begin{blockarray}{c ccccc c ccccc}
& S_1 & \cdots & S_j & \cdots & S_N & & S_1 & \cdots & S_i & \cdots & S_N \\
\cmidrule{2-6} \cmidrule{8-12}
\begin{block}{c [ccccc] c [ccccc]}
T_1 & \fixhd{b} x_1 & \cdots & 0 & \cdots & 0 & T_{N+1} & 0 & \cdots & \cX_i^1 & \cdots & \cX_N^1 \\
\vdots & \vdots & \ddots & \vdots & \cdots & \vdots &
\vdots & \vdots & \ddots & \vdots & \cdots & \vdots \\
T_j & 0 & \cdots & x_j & \cdots & 0 & T_{N+i} & \cX_1^i & \cdots & 0 & \cdots & \cX_N^i \\
\vdots & \vdots & \ddots & \vdots & \cdots & \vdots &
\vdots & \vdots & \ddots & \vdots & \cdots & \vdots \\
T_N & 0 & \cdots & 0 & \cdots & x_N & T_{2N} & \cX_1^N & \cdots & \cX_i^N & \cdots & 0 \fixhd{t} \\
\end{block}
\noalign{\vspace{-1.5ex}}
& \BAmulticolumn{5}{c}{%
\underbrace{\hphantom{\begin{bmatrix}x_1&\cdots&x_j&\cdots&x_N\end{bmatrix}}}%
_{\text{Broadcasting phase}}%
}
&& \BAmulticolumn{5}{c}{%
\underbrace{\hphantom{\begin{bmatrix}\cX^N&\cdots&\cX^N&\cdots&\cX^N\end{bmatrix}}}%
_{\text{Cooperation phase}}%
}
\\
\end{blockarray}
\]
\end{document}
The \fixhd
trick makes slightly bigger fences.

Best Answer
You can use
to render
\overset
places the first argument over the second argument and\verb
renders out exactly what its argument is in code form (kind of like the difference between code and text in Stack Exchange!).Please note that both
overset
and thebmatrix
environment are provided by theamsmath
package, so make sure to add\usepackage{amsmath}
to your preamble.