union
fixed.Interval 对象的并集
说明
返回 C = union(A, B)fixed.Interval 对象 A 和 B 的并集。
示例
创建两个 fixed.Interval 对象。
interval1 = fixed.Interval(-10, 10)
interval1 =
[-10,10]
1x1 fixed.Interval with properties:
LeftEnd: -10
RightEnd: 10
IsLeftClosed: true
IsRightClosed: true
interval2 = fixed.Interval(0,20)
interval2 =
[0,20]
1x1 fixed.Interval with properties:
LeftEnd: 0
RightEnd: 20
IsLeftClosed: true
IsRightClosed: true
找到两个 Interval 对象的并集。
intervalUnion = union(interval1, interval2)
intervalUnion =
[-10,20]
1x1 fixed.Interval with properties:
LeftEnd: -10
RightEnd: 20
IsLeftClosed: true
IsRightClosed: true
输出是一个 Interval 对象,其范围是两个输入对象的范围的并集。
当两个输入 Interval 对象的范围不重叠时,输出是覆盖输入范围并集的 Interval 对象数组。
interval3 = fixed.Interval(100, 200)
interval3 =
[100,200]
1x1 fixed.Interval with properties:
LeftEnd: 100
RightEnd: 200
IsLeftClosed: true
IsRightClosed: true
intervalUnion = union(interval1, interval3)
intervalUnion =
[-10,10] [100,200]
1x2 fixed.Interval with properties:
LeftEnd
RightEnd
IsLeftClosed
IsRightClosed
输入参数
输入 fixed.Interval 对象,指定为 fixed.Interval 对象或 fixed.Interval 对象数组。
输出参量
输入 fixed.Interval 对象的并集,以 fixed.Interval 对象或 fixed.Interval 对象数组形式返回。
输出 Interval 对象包含 A 或 B 中的所有值。
版本历史记录
在 R2019b 中推出
另请参阅
fixed.Interval | contains | intersect | overlaps | setdiff
MATLAB Command
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)