帮助中心帮助中心
polyshape 的边界框
polyshape
[xlim,ylim] = boundingbox(polyin)
[xlim,ylim] = boundingbox(polyin,I)
示例
[xlim,ylim] = boundingbox(polyin) 返回包围在 polyshape 外面的最小矩形的 x 和 y 边界。xlim 和 ylim 是二元素行向量,其中的第一个元素对应于 x 和 y 下界,第二个元素对应于 x 和 y 上界。
xlim
ylim
polyin
当 polyin 是由 polyshape 对象组成的数组时,xlim 和 ylim 是指包围在 polyin 的所有 polyshape 元素外面的边界框。
[xlim,ylim] = boundingbox(polyin,I) 返回 polyin 的第 I 个边界的边界框范围。
I
仅当 polyin 是标量 polyshape 对象时,才支持此语法。
全部折叠
创建包含两个实心区域的多边形,并计算包围在外面的边界框的 x 和 y 上界和下界。
x1 = [0 1 2]; y1 = [0 1 0]; x2 = [2 3 4]; y2 = [1 2 1]; polyin = polyshape({x1,x2},{y1,y2}); [xlim,ylim] = boundingbox(polyin); plot(polyin) hold on plot(xlim,ylim,'r*',xlim,fliplr(ylim),'r*')
输入 polyshape,指定为标量、向量、矩阵或多维数组。
数据类型: polyshape
边界索引,指定为整数标量或由整数组成的向量。I 的每个元素对应于输入 polyshape 的一个边界。
当 I 是索引向量时,boundingbox 返回包围在 I 的元素所索引的所有边界外面的界限。
boundingbox
数据类型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
限制 polyshape 的 x 界限,以二元素行向量形式返回。xlim 的第一个元素是 x 下界,第二个元素是 x 上界。
数据类型: double
限制 polyshape 的 y 界限,以二元素行向量形式返回。ylim 的第一个元素是 y 下界,第二个元素是 y 上界。
用法说明和限制:
必须启用动态内存分配才能进行代码生成。
名称-值对组必须为编译时常量。
在 R2017b 中推出
polyshape | convhull
convhull
您点击的链接对应于以下 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:
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