Range intersection

版本 1.10.0.0 (1.6 KB) 作者: Xavier Xavier
Mathematical intersection of range composed of a union of intervals
1.3K 次下载
更新时间 2012/5/30

查看许可证

Purpose: Range/interval intersection

A and B two ranges of closed intervals written
as vectors [lowerbound1 upperbound1 lowerbound2 upperbound2]
or as matrix
[lowerbound1, lowerbound2, lowerboundn;
upperbound1, upperbound2, upperboundn]
A and B have to be sorted in ascending order

out is the mathematical intersection A n B

EXAMPLE USAGE:
>> out=range_intersection([1 3 5 9],[2 9])
out = [2 3 5 9]
>> out=range_intersection([40 44 55 58], [42 49 50 52])
out = [42 44]

引用格式

Xavier Xavier (2024). Range intersection (https://www.mathworks.com/matlabcentral/fileexchange/31753-range-intersection), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: Interval merging

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.10.0.0

Major modification and bug fixing

1.9.0.0

Correction of an error in the input description

1.0.0.0