clone
Copy operating point for Stateflow chart
Syntax
Description
Examples
Open the
sf_carmodel.openExample("sf_car")For more information about this model, see Model a Car with Automatic Transmission.
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
xFinal.Select Save final operating point.
Click OK.
Set the stop time for this simulation segment. In the Simulation tab, set Stop Time to
10.Run the simulation.
Access the
Stateflow.op.BlockOperatingPointobject that contains the operating point information for theshift_logicchart.blockpath = "sf_car/shift_logic"; op = get(xFinal,blockpath);Access the
Stateflow.op.OperatingPointContainerobject that contains the operating point information for thegear_statestate.op.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" + fourth "State (OR)" + second "State (OR)" (active) + third "State (OR)"The operating point shows that the substate
secondis active.Create a copy of the operating point.
newOp = clone(op);
Modify the new operating point by changing the active substate of
gear_state.setActive(newOp.gear_state.first)
Verify that the substate
firstis active in the modified operating point.newOp.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" (active) + fourth "State (OR)" + second "State (OR)" + third "State (OR)"Verify that the substate
secondis active in the original operating point.op.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" + fourth "State (OR)" + second "State (OR)" (active) + third "State (OR)"
Input Arguments
Operating point for a Stateflow chart, specified as a Stateflow.op.BlockOperatingPoint object.
Output Arguments
Copy of operating point, returned as a Stateflow.op.BlockOperatingPoint 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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)