MATLAB 帮助中心
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
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处