Main Content

overlaps

Determine if two fixed.Interval objects overlap

Since R2019b

Description

example

bool = overlaps(A, B) returns a boolean indicating whether two fixed.Interval objects overlap.

Examples

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.

Input Arguments

collapse all

Input fixed.Interval objects, specified as fixed.Interval objects, or arrays of fixed.Interval objects.

Output Arguments

collapse all

Whether the input fixed.Interval objects overlap, returned as a logical value or a vector of logical values.

Version History

Introduced in R2019b