DocumentationHelp Center
Remove holes in polyshape
polyshape
polyout = rmholes(polyin)
example
polyout = rmholes(polyin) returns a polyshape object made up of the solid boundaries of the polygon polyin, with all the hole boundaries removed.
polyin
collapse all
Create a polygon with a hole.
t = 0.05:0.5:2*pi; x1 = cos(t); y1 = sin(t); x2 = 0.5*cos(t); y2 = 0.5*sin(t); polyin = polyshape({x1,x2},{y1,y2})
polyin = polyshape with properties: Vertices: [27x2 double] NumRegions: 1 NumHoles: 1
plot(polyin)
Create a new polygon with the hole removed.
polyout = polyshape with properties: Vertices: [13x2 double] NumRegions: 1 NumHoles: 0
plot(polyout)
Input polyshape, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: polyshape
holes | ishole | polyshape | rmboundary
holes
ishole
rmboundary
A modified version of this example exists on your system. Do you want to open this version instead?
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