This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Number of polyshape boundaries


N = numboundaries(polyin)



N = numboundaries(polyin) returns the number of boundaries of a polyshape object.


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});

N = numboundaries(polyin)
N = 2

Input Arguments

collapse all

Input polyshape, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: polyshape

Introduced in R2017b