주요 콘텐츠

intersect

fixed.Interval 객체의 교집합

설명

C = intersect(A, B)fixed.Interval 객체 AB의 교집합을 반환합니다.

예제

예제

모두 축소

fixed.Interval 객체를 만듭니다.

interval1 = fixed.Interval(-10,10)
interval1 = 
    [-10,10]

  1x1 fixed.Interval with properties:

              LeftEnd: -10
             RightEnd: 10
         IsLeftClosed: true
        IsRightClosed: true
interval2 = fixed.Interval(0,20)
interval2 = 
    [0,20]

  1x1 fixed.Interval with properties:

              LeftEnd: 0
             RightEnd: 20
         IsLeftClosed: true
        IsRightClosed: true

Interval 객체의 교집합을 구합니다.

intervalIntersection12 = intersect(interval1,interval2)
intervalIntersection12 = 
    [0,10]

  1x1 fixed.Interval with properties:

              LeftEnd: 0
             RightEnd: 10
         IsLeftClosed: true
        IsRightClosed: true

출력값은 두 Interval 입력 객체의 범위의 교집합을 범위로 갖는 Interval 객체입니다.

Interval 입력 객체의 범위가 겹치지 않을 경우 출력값은 빈 Interval 객체입니다.

interval3 = fixed.Interval(100,200)
interval3 = 
    [100,200]

  1x1 fixed.Interval with properties:

              LeftEnd: 100
             RightEnd: 200
         IsLeftClosed: true
        IsRightClosed: true
intervalIntersection13 = intersect(interval1,interval3)
intervalIntersection13 = 

  1x0 fixed.Interval with properties:

              LeftEnd
             RightEnd
         IsLeftClosed
        IsRightClosed

입력 인수

모두 축소

입력 fixed.Interval 객체로, fixed.Interval 객체 또는 fixed.Interval 객체로 구성된 배열로 지정됩니다.

출력 인수

모두 축소

입력 fixed.Interval 객체의 교집합으로, fixed.Interval 객체 또는 fixed.Interval 객체로 구성된 배열로 반환됩니다.

출력 Interval 객체에는 두 입력 AB 양쪽 모두에 있는 값이 포함됩니다.

버전 내역

R2019b에 개발됨