Help CenterHelp Center
Perimeter ofpolyshape
polyshape
P = perimeter(polyin)
P = perimeter(polyin,I)
example
P = perimeter(polyin)returns the perimeter of apolyshapeobject, which is the sum of the lengths of its boundaries.
polyin
P = perimeter(polyin,I)returns the perimeter of theIth boundary ofpolyin.
I
This syntax is only supported whenpolyinis a scalarpolyshapeobject.
collapse all
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) axisequal
P = 12
Inputpolyshape, specified as a scalar, vector, matrix, or multidimensional array.
Data Types:polyshape
Boundary index, specified as a scalar integer or vector of integers. Each element ofIcorresponds to a single boundary of the inputpolyshape.
Data Types:double|single|int8|int16|int32|int64|uint8|uint16|uint32|uint64
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
centroid|polyshape|area
centroid
area
You have a modified version of this example. Do you want to open this example with your edits?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office