0

How can I get extract the x1, y1, x2, y2 from the roi.Position to matching variables (x1, y1, x2, y2)?

function drawLineButtonPushed(app, event)
   roi = drawline(app.myAxes)
   disp(roi.Position);
end
jane
  • 567
  • 2
  • 12

1 Answers1

2

drawline allows the user to a draw a line connecting two points A and B on the chosen axis. The XY positions of A ([Ax Ay]) and B ([Bx By]) are simply:

roi = drawline(app.myAxes);
Ax = roi.Position(1);
Bx = roi.Position(2);
Ay = roi.Position(3);
By = roi.Position(4);
If_You_Say_So
  • 1,195
  • 1
  • 10
  • 25