Help CenterHelp Center
Perimeter of polyshape
polyshape
P = perimeter(polyin)
P = perimeter(polyin,I)
example
P = perimeter(polyin) returns the perimeter of a polyshape object, which is the sum of the lengths of its boundaries.
polyin
P = perimeter(polyin,I) returns the perimeter of the Ith boundary of polyin.
I
This syntax is only supported when polyin is a scalar polyshape object.
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) axis equal
P = 12
Input polyshape, 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 of I corresponds to a single boundary of the input polyshape.
Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
Usage notes and limitations:
Dynamic memory allocation must be enabled for code generation.
Name-value pair must be compile time constant.
Introduced in R2017b
centroid | polyshape | area
centroid
area
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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