MATLAB: How do you get an arbitrary 1 dimensional line scan from a 2D Matrix

matrix manipulation

Hello,
say I had a NxN Matrix
Is there any easy way to plot a line scan from any arbitrary points (x1,y1) to (x2,y2)?
Example, attached is a 256×256 variable tdelt
I want a line profile of the data between the points (81,96) and (188,40)
Not sure How I can do this
Thanks!

Best Answer