Labels and captions of a matrix

1,148

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.

enter image description here

Share:
1,148

Related videos on Youtube

MA Jadoon
Author by

MA Jadoon

Student of Electrical Engineering at University of Ulsan, South Korea.

Updated on August 26, 2020

Comments

  • MA Jadoon
    MA Jadoon about 3 years

    Can someone please let me know how to write the following equation in Latex. Thanks enter image description here