Use the unique
function to get a non-overlapping
set of intervals from an array of Interval
objects.
[-5,5] [-10,10] [4,20] [50,100]
1x4 fixed.Interval with properties:
LeftEnd
RightEnd
IsLeftClosed
IsRightClosed
The first three intervals represented in the object overlap with one another. The
fourth interval is disjointed from the set.
uniqueInterval =
[-10,20] [50,100]
1x2 fixed.Interval with properties:
LeftEnd
RightEnd
IsLeftClosed
IsRightClosed
The output, uniqueInterval
, an array of two
Interval
objects, merges the three overlapping intervals into a
single Interval
object.