clone
复制 Stateflow 图的工作点
说明
示例
打开
sf_car模型。openExample("sf_car")有关此模型的详细信息,请参阅Model a Car with Automatic Transmission。
设置模型以保存最终工作点。打开“配置参数”对话框,并在数据导入/导出窗格中执行以下操作:
选择最终状态并输入工作点的名称。对于此示例,请使用
xFinal。选择保存最终工作点。
点击确定。
设置此仿真段的停止时间。在仿真选项卡中,将停止时间设置为
10。运行仿真。
访问包含
shift_logic图的工作点信息的Stateflow.op.BlockOperatingPoint对象。blockpath = "sf_car/shift_logic"; op = get(xFinal,blockpath);访问包含
gear_state状态的工作点信息的Stateflow.op.OperatingPointContainer对象。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)"工作点显示子状态
second被激活。创建工作点的一个副本。
newOp = clone(op);
通过更改
gear_state的激活子状态修改新工作点。setActive(newOp.gear_state.first)
验证子状态
first在修改后的工作点中被激活。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)"验证子状态
second在原始工作点中被激活。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)"
输入参数
Stateflow 图的工作点,指定为 Stateflow.op.BlockOperatingPoint 对象。
输出参量
工作点的副本,以 Stateflow.op.BlockOperatingPoint 对象形式返回。
版本历史记录
在 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)