MATLAB: Endpoints of drawline()

graphlineplot

Hi all,
I'm trying to record the endpoints of the drawline() function in an array so I could record the distance. Is there a way to do this? Or is there a better way to draw a line and record the endpoints' coordinates/ calculate the distance between the endpoints?
Thanks!

Best Answer

h = drawline();
ep = h.Position;
x1 = ep(1,1); y1 = ep(1,2); x2 = ep(2,1); y2 = ep(2,2);
Related Question