Main Content

isActive

상태가 활성화되어 있는지 확인

    설명

    예제

    tf = isActive(stateOp)stateOp가 활성화된 상태의 동작점인 경우 논리값 1(true)을 반환합니다. 그렇지 않으면 함수는 논리값 0(false)을 반환합니다.

    예제

    모두 축소

    1. sf_aircraft 모델을 엽니다.

      openExample("sf_aircraft")

      이 모델에 대한 자세한 내용은 Detect Faults in Aircraft Elevator Control System 항목을 참조하십시오.

    2. 최종 동작점을 저장하도록 모델을 설정합니다. 구성 파라미터 대화 상자를 열고 데이터 가져오기/내보내기 창에서 다음을 수행하십시오.

      1. 최종 상태를 선택하고 동작점의 이름을 입력합니다. 이 예제에서는 xSteadyState를 사용합니다.

      2. 최종 동작점 저장을 선택합니다.

      3. 확인을 클릭합니다.

    3. 이 시뮬레이션 세그먼트의 중지 시간을 설정합니다. 시뮬레이션 탭에서 중지 시간3으로 설정합니다.

    4. 시뮬레이션을 실행합니다.

    5. Mode Logic 차트의 동작점 정보가 포함된 Stateflow.op.BlockOperatingPoint 객체에 액세스합니다.

      blockpath = "sf_aircraft/Mode Logic";
      op = get(xSteadyState,blockpath)
      op = 
      
        Block:    "Mode Logic"    (handle)    (active)
        Path:     sf_aircraft/Mode Logic
      
        Contains:
      
          + Actuators          "State (OR)"                    (active)
          + LI_act             "Function"
          + LO_act             "Function"
          + L_switch           "Function"
          + RI_act             "Function"
          + RO_act             "Function"
          + R_switch           "Function"
            LI_mode            "State output data"		sf_aircraft_ModeType [1,1]
            LO_mode            "State output data"		sf_aircraft_ModeType [1,1]
            RI_mode            "State output data"		sf_aircraft_ModeType [1,1]
            RO_mode            "State output data"		sf_aircraft_ModeType [1,1]
    6. Actuators 상태의 동작점 정보가 포함된 Stateflow.op.OperatingPointContainer 객체에 액세스합니다.

      op.Actuators
      ans = 
      
        State:    "Actuators"    (handle)    (active)
        Path:     sf_aircraft/Mode Logic/Actuators
      
        Contains:
      
          + LI            "State (AND)"         (active)
          + LO            "State (AND)"         (active)
          + RI            "State (AND)"         (active)
          + RO            "State (AND)"         (active)
      
    7. t = 3에서 차트에서 활성화된 상태를 강조 표시합니다.

      highlightActiveStates(op)

      Stateflow chart showing active states.

    8. 왼쪽 바깥 액추에이터의 실패를 반영하도록 상태 LO의 하위 상태 활동을 변경합니다.

      setActive(op.Actuators.LO.Isolated)

      Stateflow chart showing active states.

    9. 상태 LO의 하위 상태 Isolated가 수정한 동작점에서 활성화되어 있는지 확인합니다.

      isActive(op.Actuators.LO.Isolated)
      ans =
      
        logical
      
         1

    10. Stateflow® 편집기에서 활성 상태의 강조 표시를 제거합니다.

      removeHighlighting(op)

    입력 인수

    모두 축소

    상태의 동작점으로, Stateflow.op.OperatingPointContainer 객체로 지정됩니다.

    버전 내역

    R2009b에 개발됨