numRegions
alpha 形状中的区域数
说明
示例
计算二维 alpha 形状中的区域数
创建并绘制一个二维点集。
th = (pi/12:pi/12:2*pi)'; x1 = [reshape(cos(th)*(1:5), numel(cos(th)*(1:5)),1); 0]; y1 = [reshape(sin(th)*(1:5), numel(sin(th)*(1:5)),1); 0]; x = [x1; x1+15;]; y = [y1; y1]; plot(x,y,'.') axis equal
使用 alpha 半径 7 创建一个 alpha 形状,并查询该形状中的不同区域数。
shp = alphaShape(x,y,7); nregions = numRegions(shp)
nregions = 1
使用较小的 alpha 半径 2.5 可更好地捕获边界,然后检索新的不同区域数。
shp.Alpha = 2.5; nregions = numRegions(shp)
nregions = 2
绘制 alpha 形状以检查边界质量。
plot(shp)
输入参数
shp
— alpha 形状
alphaShape
对象
alpha 形状,指定为 alphaShape
对象。有关详细信息,请参阅 alphaShape
。
示例: shp = alphaShape(x,y)
根据 (x,y)
点坐标创建一个二维 alphaShape
对象。
版本历史记录
在 R2014b 中推出
另请参阅
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)