contains
Determine if one fixed.Interval
object contains
another
Syntax
Description
returns a boolean indicating whether bool
= contains(A, B
)fixed.Interval
object A
contains the
fixed.Interval
object B
.
Examples
Determine If a fixed.Interval
Object Contains Another
Create two fixed.Interval
objects. Use the contains
function to determine if the intervals in interval2
are contained within the corresponding intervals in interval1
.
interval1 = fixed.Interval({0,1}, {2,3}, {3,4}); interval2 = fixed.Interval({0,0.5}, {2.5, 3}, {4,5}); bool = contains(interval1, interval2)
bool = 1x3 logical array
1 1 0
When the second input is a scalar Interval
object, contains
determines whether each interval of the first input contains the interval of the second input.
interval2 = fixed.Interval(0,1); bool = contains(interval1, interval2)
bool = 1x3 logical array
1 0 0
Input Arguments
A, B
— Input fixed.Interval
objects
fixed.Interval
object | array of fixed.Interval
objects
Input fixed.Interval
objects, specified as fixed.Interval
objects, or arrays of fixed.Interval
objects.
If A
is an array of Interval
objects,
B
must be a scalar Interval
object or an
Interval
object with the same dimensions as
A
.
Output Arguments
bool
— Whether B
is contained in A
true | false | logical array
Whether fixed.Interval
object B
is contained
in fixed.Interval
object A
, returned as a logical
value.
When A
is an array of Interval
objects, the
output is an array of logical values of the same size as A
.
Version History
Introduced in R2019b
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.
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
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)