simplify
简化 polyshape
边界
说明
示例
相交边界
创建并绘制包含边界交集的多边形。
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
plot(polyin)
使用 simplify
函数删除交集,生成一个明确定义的多边形。简化多边形会保持边界的形状,但会将多边形分成两个不同的区域。
polyout = simplify(polyin)
polyout = polyshape with properties: Vertices: [7x2 double] NumRegions: 2 NumHoles: 0
输入参数
polyin
— 输入 polyshape
标量 | 向量 | 矩阵 | 多维数组
输入 polyshape
,指定为标量、向量、矩阵或多维数组。
数据类型: polyshape
TF
— 共线顶点指示符
false
| true
共线顶点指示符,指定为 false
或 true
:
false
- 删除共线点,使输出polyshape
包含定义边界所需的最少顶点。true
- 保留所有共线点作为顶点。
如果未指定 'KeepCollinearPoints'
参数,则其值将自动设置为在创建输入 polyshape
时使用的值。
数据类型: logical
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
用法说明和限制:
必须启用动态内存分配才能进行代码生成。
名称-值对组必须为编译时常量。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
版本历史记录
在 R2017b 中推出
另请参阅
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)