Draw Shapes and Lines
When you specify the type of shape to draw, you must also specify its location on the image. The table shows the format for the points input for the different shapes.
Rectangle
Shape | PTS input | Drawn Shape |
---|---|---|
Single Rectangle | Four-element row vector [x y width
height] where
|
|
M Rectangles | M-by-4 matrix |
|
Line and Polyline
You can draw one or more lines, and one or more polylines. A polyline contains a series of connected line segments.
Shape | PTS input | Drawn Shape |
---|---|---|
Single Line | Four-element row vector [x1 y1 x2 y2] where
|
|
M Lines | M-by-4 matrix |
|
Single Polyline with (L-1) Segments | Vector of size 2L, where L is
the number of vertices, with format, [x1,
y1, x2, y2,
..., xL, yL] .
|
|
M Polylines with (L-1) Segments | 2L-by-N matrix where each row of the matrix corresponds to a different polyline and is of the same form as the vector for a single polyline. When you require one polyline to contain less than (L–1) number of segments, fill the matrix by repeating the coordinates of the last vertex. The block produces an error message if the number of rows is less than two or not a multiple of two. |
|
Polygon
You can draw one or more polygons.
Shape | PTS input | Drawn Shape |
---|---|---|
Single Polygon with L line segments | Row vector of size 2L, where L is
the number of vertices, with format, [x1 y1 x2 y2 ...
xL yL] where
[x1 y1] to [xL yL] to
complete the polygon. The block produces an error if the number of
rows is negative or not a multiple of two. |
|
M Polygons with the largest number of line segments in any line being L | M-by-2L matrix where each row of the matrix corresponds to a different polygon and is of the same form as the vector for a single polygon. If some polygons are shorter than others, repeat the ending coordinates to fill the polygon matrix. The block produces an error message if the number of rows is less than two or is not a multiple of two. |
|
Circle
You can draw one or more circles.
Shape | PTS input | Drawn Shape |
---|---|---|
Single Circle | Three-element row vector[x y radius] where
|
|
M Circles | M-by-3 matrix |
|
See Also
insertObjectAnnotation
| insertShape
| insertMarker
| insertText