title: Interpolate out of vector range to split image in MATLAB
body: <p>I have an image, and I'm letting the user draw a line on it to pick a region. Now, I would like to take that line (red line in the attached image) and extend it to get to the ends of the frame from both sides (white line in image).
  I tried using <code>interp1</code> but when I'm trying to get those coordinates on the frame itself, I get NaNs since it's not between the two points that the user picked.</p>
  
  <p>Any suggestions on how to pick those points? Or alternatively, a better way to split the image?</p>
  
  <p><a href="https://i.stack.imgur.com/TgmF5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TgmF5.jpg" alt="enter image description here"></a></p>