Number of polyshape boundaries
polyshape
N = numboundaries(polyin)
example
N = numboundaries(polyin) returns the number of boundaries of a polyshape object.
polyin
collapse all
Create a polygon and determine its number of boundaries.
x1 = [0 1 2]; y1 = [0 1 0]; x2 = [2 3 4]; y2 = [1 2 1]; polyin = polyshape({x1,x2},{y1,y2}); plot(polyin)
N = 2
Input polyshape, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: polyshape
boundary | numsides | polyshape
boundary
numsides
You have a modified version of this example. Do you want to open this example with your edits?