drawline

版本 1.0.0.0 (3.1 KB) 作者: Daniel Lopes
Draws line segments on a image matrix.
4.1K 次下载
更新时间 2007/11/6

查看许可证

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.

引用格式

Daniel Lopes (2024). drawline (https://www.mathworks.com/matlabcentral/fileexchange/15374-drawline), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Daniel Drucker spotted a bug.

"Line 62 should read:
for line_number = 1:size(p1,1)
Otherwise, it fails when there is only one point in p1 and p2."

It has now been corrected!