Number of polyshape sides
polyshape
N = numsides(polyin)
N = numsides(polyin,I)
example
N = numsides(polyin) returns the number of sides of a polyshape object.
polyin
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
numboundaries | polyshape
numboundaries
You have a modified version of this example. Do you want to open this example with your edits?