polyout = simplify( returns a
polyshape object made up of the boundaries of the polygon
polyin with all vertex duplicates removed, and all boundary
intersections and improper nesting resolved.
Create and plot a polygon that contains a boundary intersection.
P = [0 0; 1 1; 1 0; 0.5 0.5; 0 1; 0 0]; polyin = polyshape(P,'Simplify',false)
polyin = polyshape with properties: Vertices: [5x2 double] NumRegions: 1 NumHoles: 0
simplify function to remove the intersection, which produces a well-defined polygon. Simplifying the polygon maintains the boundary shape, but splits the polygon into two distinct regions.
polyout = simplify(polyin)
polyout = polyshape with properties: Vertices: [7x2 double] NumRegions: 2 NumHoles: 0
polyin — Input
scalar | vector | matrix | multidimensional array
polyshape, specified as a scalar, vector, matrix,
or multidimensional array.
TF — Collinear vertices indicator
Collinear vertices indicator, specified as
false— Remove collinear points so that the output
polyshapecontains the fewest vertices necessary to define the boundaries.
true— Keep all collinear points as vertices.
'KeepCollinearPoints' parameter is not
specified, its value is automatically set to the value used when creating
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Dynamic memory allocation must be enabled for code generation.
Name-value pair must be compile time constant.
Introduced in R2017b