主要内容

convertToSTT

Stateflow 图转换为状态转移表

自 R2023b 起

说明

table = convertToSTT(chart) 将未锁定的 Stateflow®chart 转换为状态转移表。

示例

示例

全部折叠

此示例说明如何将 Stateflow® 图转换为状态转移表。

打开示例模型并访问 Stateflow.Chart 对象。

open_system("sf_aircontrol")
chart = find(sfroot,"-isa","Stateflow.Chart");
view(chart)

Stateflow chart that contains top level states, PowerOn and PowerOff. PowerOn has parallel substates FAN1, FAN2, and SpeedValue. Each of FAN1 and FAN2 have exclusive substates On and Off.

将图转换为状态转移表。

table = convertToSTT(chart);
view(table)

State transition table that represents the same logic as the original chart. The table displays the top level states, PowerOn and PowerOff. The hierarchy under state PowerOn is hidden by default.

要显示状态 Power_On 的子状态,请点击状态左侧的 按钮。

State transition table that represents the same logic as the original chart. The table displays the top level states, PowerOn and PowerOff. The hierarchy under state PowerOn is expanded, and shows parallel substates FAN1, FAN2, and SpeedValue.

输入参数

全部折叠

要转换的 Stateflow 图,指定为 Stateflow.Chart 对象。

限制

  • 不支持包含超转移的图。

  • 图必须位于 Simulink® 模型的顶层。

  • 图不能包含变体转移。

版本历史记录

在 R2023b 中推出