isActive
Determine if state is active
Syntax
Description
Examples
Modify Operating Point Information for State Activity
Open the
sf_aircraft
model.openExample("stateflow/FaultDetectionControlLogicInAnAircraftControlSystemExample")
For more information about this model, see Detect Faults in Aircraft Elevator Control System.
Set the model to save the final operating point. Open the Configuration Parameters dialog box and, in the Data Import/Export pane:
Select Final states and enter a name for the operating point. For this example, use
xSteadyState
.Select Save final operating point.
Click OK.
Set the stop time for this simulation segment. In the Simulation tab, set Stop Time to
3
.Run the simulation.
Access the
Stateflow.op.BlockOperatingPoint
object that contains the operating point information for theMode Logic
chart.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]
Access the
Stateflow.op.OperatingPointContainer
object that contains the operating point information for theActuators
state.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)
Highlight the states that are active in the chart at t = 3.
highlightActiveStates(op)
Change the substate activity in the state
LO
to reflect a failure of the left-outer actuator.setActive(op.Actuators.LO.Isolated)
Verify that the substate
Isolated
in the stateLO
is active in the modified operating point.isActive(op.Actuators.LO.Isolated)
ans = logical 1
Remove the highlighting of active states in the Stateflow® Editor.
removeHighlighting(op)
Input Arguments
stateOp
— Operating point for state
Stateflow.op.OperatingPointContainer
object
Operating point for a state, specified as a Stateflow.op.OperatingPointContainer
object.
Version History
Introduced in R2009b
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)