Help Center
Number of polyshape sides
polyshape
N = numsides(polyin)
N = numsides(polyin,I)
N = numsides(polyin) returns the number of sides of a polyshape object.
polyin
example
N = numsides(polyin,I) returns the number of sides of the Ith boundary of polyin.
I
This syntax is only supported when polyin is a scalar polyshape object.
collapse all
Create a polygon and determine its number of sides.
t = 0:0.5:2*pi; P = [cos(t)' sin(t)']; polyin = polyshape(P); plot(polyin)
N = 13
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
polyshape | numboundaries
numboundaries
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.
Select a Web Site
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
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office