I previously asked this question here, but now would like to achieve the same goal with a matrix under a different construction. More specifically, how can I highlight or shade the upper or lower triangular part of the following matrix?
The corresponding Latex code is this:
\documentclass{article}
\usepackage{blkarray}
\begin{document}
$R =
\begin{blockarray}{cccccc}
& S_1 & S_2 & S_3 & ... & S_n \\
\begin{block}{c(ccccc)}
S_1 & 1 & r_{12} & r_{13} & ... & r_{1n} \\
S_2 & r_{21} & 1 & r_{23} & ... & r_{2n} \\
S_3 & r_{31} & r_{32} & 1 & ... & r_{3n} \\
\vdots & \vdots & \vdots &\vdots & \vdots & \vdots\\
S_n & r_{n1} & r_{n2} & r_{n3} & ... & 1 \\
\end{block}
\end{blockarray},$
\end{document}
Thanks!