Rubberband Line

Draws a rubber band line and returns the x y coordinates of the end points.
4.2K Downloads
Updated 26 Mar 2002

No License

[p1,p2]=rbline(varargin)

Function to draw a rubberband line and return the start and end points. Usage: [p1,p2]=rbline; or [p1,p2]=rbline(h); where h is an axis handle. Click the mouse in the plot to define the start point. A rubberband line is drawn between the start point and the current point until the mouse is clicked again. The start point, p1, and the end point, p2, are returned. The figure UserData is not available while this function is running but is restored after it ends.

Cite As

Sandra Preaux (2024). Rubberband Line (https://www.mathworks.com/matlabcentral/fileexchange/1552-rubberband-line), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Line Plots in Help Center and MATLAB Answers
Acknowledgements

Inspired: Muscle fascicle tracking - Ultrasound

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0