File Exchange

image thumbnail


version 1.0 (3.05 KB) by

Draws line segments on a image matrix.

7 Ratings



View License

DRAWLINE Returns the geometric space (matrix indices) occupied by a line segment in a MxN matrix. Each line segment is defined by two endpoints.

IND = DRAWLINE(P1, P2, IMAGE_SIZE) returns the matrix indices of the line segment with endpoints p1 and p2. If both points are out of the image boundary no line is drawn and an error will appear. If only one of the endpoints is out of the image boundary a line is still drawn.

Comments and Ratings (8)


Sujeet (view profile)

is there anyway I could draw a thick white line using this command? since, the line is too thin, I was not able to detect it using houghs transform.. pls help. thanks in advance..

B Treeby

Useful function, thank!

B Treeby

Stephen blo

Does not draw conected lines.
Line Points are not all connected.

Warning: Divide by zero.
> In drawline at 148

Shawn L

works great. Thanks for saving me some time!

Ze Ji

useful for me, thanks

ali ali

good work

Olivier Salvado

it works...

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today