regions
访问 polyshape
区域
说明
示例
多边形区域数组
计算包含两个实心区域的多边形。然后创建一个向量,其元素是多边形的一个区域。
P = [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; NaN NaN; 3 0.5; 3.5 1.5; 4 0.5; NaN NaN; 3.25 0.6; 3.75 0.6; 3.5 1]; polyin = polyshape(P); plot(polyin) xlim([-0.5 4.5]) ylim([-0.5 2.5])
polyout = regions(polyin)
polyout = 2x1 polyshape array with properties: Vertices NumRegions NumHoles
plot(polyout(1)) xlim([-0.5 4.5]) ylim([-0.5 2.5])
plot(polyout(2)) xlim([-0.5 4.5]) ylim([-0.5 2.5])
输入参数
polyin
— 输入 polyshape
标量
输入 polyshape
,指定为标量。
数据类型: polyshape
版本历史记录
在 R2017b 中推出
另请参阅
boundary
| sortregions
| polyshape
| holes
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)