Create a polygon with one hole, and compute its perimeter.
V = [0 0; 0 2; 2 2; 2 0; NaN NaN; 0.5 0.5; 0.5 1.5; 1.5 1.5; 1.5 0.5]; polyin = polyshape(V); plot(polyin) axis equal
P = perimeter(polyin)
P = 12
polyshape, specified as a scalar, vector, matrix,
or multidimensional array.
I— Boundary index
Boundary index, specified as a scalar integer or vector of integers. Each
I corresponds to a single boundary of the