k-Wave Toolbox


Create a binary map of a straight line within a 2D grid.


line = makeLine(Nx, Ny, startpoint, endpoint)
line = makeLine(Nx, Ny, startpoint, angle, length)


makeLine creates a binary map of a line within a two-dimensional grid (the line is denoted by 1's in the matrix with 0's elsewhere). The line can be defined either by its endpoints or by a starting point, an angle (direction), and a length.


Nx, Ny size of the 2D grid [grid points]
startpoint two-element vector identifying the start point for the line [grid points]
endpoint two-element vector identifying the end point for the line [grid points]
angle the direction of the line [radians]
length the length of the line [grid points]


line 2D binary map of a line

See Also

makeArc, makeCircle, makeDisc