Lets say I have a gaussian data matrix, e.g.
x=GaussianMatrix[20]
I would like to take a cut through this matrix at a 45 degree angle to get its intensity profile, like this:
rather than a straight line cut in the x or y coordinates. Is there a way to do this?



Diagonal[x]to get the main diagonal, orDiagonal[x, k]to get elements on the $k$-th diagonal. – Domen Aug 25 '21 at 10:10Binarize[Rasterize[Graphics[Line[{{0, 0}, {2, 3}}]], RasterSize -> 40]]. – Domen Aug 25 '21 at 10:42