Main Content

isDegenerate

Determine whether the left and right ends of a fixed.Interval object are degenerate

Since R2019b

Description

example

bool = isDegenerate(A) returns a boolean indicating whether the left and right ends of the fixed.Interval object A are the same, or equivalently, whether the interval contains only one point.

Examples

collapse all

Create a fixed.Interval object. Use the isDegenerate function to determine whether the left and right ends of the Interval object are the same.

interval = fixed.Interval({-pi,pi},{1,1});
bool = isDegenerate(interval)
bool = 1x2 logical array

   0   1

The output is a logical 0 when the left and right ends of the interval are different, and 1 when they are the same.

Input Arguments

collapse all

Input fixed.Interval object, specified as a fixed.Interval object, or an array of fixed.Interval objects.

Output Arguments

collapse all

Indicates whether the fixed.Interval object A has degenerate end points. Returns 1 (true) when the left and right ends of A are the same, or equivalently, when the interval contains only one point, and 0 (false) otherwise.

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