I have a matrix and need to highlight some elements in the matrix as in the example.
Thanks
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc,arrows,automata,positioning}
\usepackage{blkarray}
\begin{document}
\begin{frame}{Example}
\begin{figure}[H]
\centering
\begin{tabular}{c c}
\begin{minipage}{.5\linewidth}
\scalebox{0.5}{
$
\renewcommand\arraystretch{1.3}
\begin{blockarray}{ccccccc}
& 1 & 2 & 3 & 4 & 5 & 6 \\
\begin{block}{@{}c\{[ccccc]c}
1 & 0 & 1 & 0 & 0 & 0 & 0 \\
2 & 0 & 0 & 1 & 0 & 1 & 0 \\
3 & 0 & 0 & 0 & 1 & 0 & 0 \\
4 & 0 & 0 & 0 & 0 & 0 & 0 \\
5 & 1 & 0 & 0 & 0 & 0 & 1 \\
6 & 0 & 1 & 0 & 0 & 0 & 0 \\
\end{block}
s & 1 & 2 & 2 & 2 & 2 \\
\end{blockarray}
$
}
\end{minipage}
\begin{minipage}{.5\linewidth}
\scalebox{0.5}{
$
\renewcommand\arraystretch{1.3}
\begin{blockarray}{ccccccc}
& 1 & 2 & 3 & 4 & 5 & 6 \\
\begin{block}{@{}c\{[ccccc]c}
1 & 0 & 1 & 0 & 0 & 0 & 0 \\
2 & 0 & 0 & 1 & 0 & 1 & 0 \\
3 & 0 & 0 & 0 & 1 & 0 & 0 \\
4 & 0 & 0 & 0 & 0 & 0 & 0 \\
5 & 1 & 0 & 0 & 0 & 0 & 1 \\
6 & 0 & 1 & 0 & 0 & 0 & 0 \\
\end{block}
s & 1 & 2 & 2 & 2 & 2 \\
\end{blockarray}
$
}
\end{minipage}
\end{tabular}
\caption{Example}
\end{figure}
\end{frame}
\end{document}
Best Answer
One possibility is to set nodes and then do the highlighting with overlays.