removeHighlighting
取消激活状态的突出显示
说明
示例
打开
sf_car模型。openExample("sf_car")有关此模型的详细信息,请参阅Model a Car with Automatic Transmission。
设置模型以保存最终工作点。打开“配置参数”对话框,并在数据导入/导出窗格中执行以下操作:
选择最终状态并输入工作点的名称。对于此示例,请使用
xSteadyState。选择保存最终工作点。
点击确定。
设置此仿真段的停止时间。在仿真选项卡中,将停止时间设置为
3。运行仿真。
访问包含
shift_logic图的工作点信息的Stateflow.op.BlockOperatingPoint对象。blockpath = "sf_car/shift_logic"; op = get(xSteadyState,blockpath)op = Block: "shift_logic" (handle) (active) Path: sf_car/shift_logic Contains: + gear_state "State (AND)" (active) + selection_state "State (AND)" (active) gear "State output data" gearType [1, 1] down_th "Local data" double [1, 1] up_th "Local data" double [1, 1] datasetWrittenToVector "Data set written to vector" logical 4x1访问包含
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)" (active) + fourth "State (OR)" + second "State (OR)" + third "State (OR)"突出显示图中在 t = 3 处被激活的状态。
highlightActiveStates(op)

更改状态
gear_state中的子状态活动以反映挡位的变化。setActive(op.gear_state.second)

验证状态
gear_state中的子状态second在修改后的工作点中被激活。isActive(op.gear_state.second)
ans = logical 1
取消 Stateflow 编辑器中激活状态的突出显示。
removeHighlighting(op)
输入参数
Stateflow 图的工作点,指定为 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)