It seems that Claudio FiandrinoClaudio Fiandrino forgot to mention his hf-tikz package as an option for this question.
\documentclass{article} \usepackage{hf-tikz} \begin{document} \[P= \left( \begin{array}{*{13}{c}} \tikzmarkin{a}(0.1,-0.1)(-0.1,0.35)0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 1\tikzmarkend{a} & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & \tikzmarkin{b}(0.1,-0.1)(-0.1,0.35)0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\tikzmarkend{b} & 1 & 0 \end{array} \right) \] \end{document} 