clone
Copy operating point for Stateflow chart
Syntax
Description
Examples
Open the
sf_car
model.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.BlockOperatingPoint
object that contains the operating point information for theshift_logic
chart.blockpath = "sf_car/shift_logic"; op = get(xFinal,blockpath);
Access the
Stateflow.op.OperatingPointContainer
object that contains the operating point information for thegear_state
state.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
second
is 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
first
is 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
second
is 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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)