MATLAB Help Center
Determine if two fixed.Interval objects overlap
fixed.Interval
bool = overlaps(A, B)
bool = overlaps(A, B) returns a boolean indicating whether two fixed.Interval objects overlap.
bool
A, B
example
collapse all
Create two fixed.Interval objects and determine if their ranges overlap.
interval1 = fixed.Interval(-1, 1); interval2 = fixed.Interval(0, 1); overlaps(interval1, interval2)
ans = logical 1
When the ranges of the Interval objects overlap, the overlaps function returns a value of 1, or true.
Interval
overlaps
true
Input fixed.Interval objects, specified as fixed.Interval objects, or arrays of fixed.Interval objects.
Whether the input fixed.Interval objects overlap, returned as a logical value or a vector of logical values.
Introduced in R2019b
fixed.Interval | contains | intersect | setdiff | union | unique
contains
intersect
setdiff
union
unique
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.
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
Europe
Asia Pacific
Contact your local office