Two solutions with pstricks
: one with a simple frame around the diagonal elements and another which adds a coloured background. The pst-node
module has a dedicated command for that – \ncbox
:
\documentclass[svgnames]{article}
\usepackage{amsmath, xcolor}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\begin{document}
\[
A = \begin{bmatrix}
\rnode{B}{\color{red}{1}} & 2 & 3 & 4\\
1 & \color{red}{2} & 3 & 4\\
1 & 2 & \textcolor{red}{3} & 4\\
1 & 2 & 3 & \rnode{E}{\color{red}{4}}
\end{bmatrix}
\ncbox[linecolor =VioletRed, boxsize=5pt, linearc=0.05]{B}{E}
\]
\[
A = \begin{bmatrix}
\rnode{B}{\color{red}{1}} & 2 & 3 & 4\\
1 & \color{red}{2} & 3 & 4\\
1 & 2 & \textcolor{red}{3} & 4\\
1 & 2 & 3 & \rnode{E}{\color{red}{4}}
\end{bmatrix}
\ncbox[linecolor =IndianRed, fillstyle=solid, fillcolor=MistyRose, opacity=0.2, boxsize=5pt, linearc=0.05, nodesep=0.8pt]{B}{E}
\]
\end{document}

Edit:
If you do no want the diagonal frame to touch the brackets, you can, omong other possibilities, change the value of the \ncbox parameter linearc=0.18
to have round extremities, or nest a simple matrix
in bmatrix
and add some spacingon each side, like this:
\[
A = \begin{bmatrix}
\:\begin{matrix}
\rnode{B}{\color{red}{1}} & 2 & 3 & 4\\
1 & \color{red}{2} & 3 & 4\\
1 & 2 & \textcolor{red}{3} & 4\\
1 & 2 & 3 & \rnode{E}{\color{red}{4}}
\end{matrix}\:
\end{bmatrix}
\ncbox[linecolor =IndianRed, fillstyle=solid, fillcolor=MistyRose, opacity=0.2, boxsize=5pt, linearc=0.05, nodesep=0.8pt]{B}{E}
\]
