It is common in literature to encounter the diagonal symbol when referring to matrices. For instance, if matrix A is diagonal, it can be denoted as [\A] where the "\" symbol is crossing the letter "A" from the upper left to the lower right corner. 

Is there any way to do this in LaTeX (maybe by the use of any particular package)?

An example of what I am intending to do can be seen on the picture below.

[![enter image description here](https://i.stack.imgur.com/DMp4Y.png)](https://i.stack.imgur.com/DMp4Y.png)