connect two pixels

Connect two pixels in a matrice/image.

You are now following this Submission

I think the created line is the most sort as it can be but if not tell me yours ideas :)

Command line
------------
result=linept2(matrice, X1, Y1, X2, Y2)
matrice : matrice where I'll write
(X1, Y1), (X2, Y2) : points to connect
result : matrix + the line

Note
----
matrice can contents anything
(X1, Y1), (X2, Y2) can be out of the matrice

Example
-------
a = linept(zeros(5, 10), 2, 2, 3, 9)
a =
0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

Cite As

Cubas Georges (2026). connect two pixels (https://www.mathworks.com/matlabcentral/fileexchange/4177-connect-two-pixels), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

the fonction's name is corrected :)