Main Content

Stateflow 编程接口

在 MATLAB® 命令提示符下创建和修改图元素

以编程方式创建和编辑 Stateflow® 图。在图中添加新对象,访问和编辑属性,设置位置,复制和粘贴对象,以及更改 Stateflow 编辑器的放大级别。

函数

全部展开

sfnewCreate Simulink model that contains an empty Stateflow block
sfrootStateflow 层次结构的根
sfclipboardClipboard object
sfgcoSelected objects in chart
Stateflow.findMatchingPortIdentify matching entry or exit port

对象

全部展开

图、模块和状态机对象

Stateflow.ChartGraphical representation of a finite state machine
Stateflow.StateTransitionTableChartTabular representation of state machine for modal logic
Stateflow.TruthTableChartTabular representation of state machine for decision logic
Stateflow.EMChartStateflow interface to MATLAB Function block
Stateflow.MachineContainer for Stateflow blocks in a Simulink model

图形对象

Stateflow.AnnotationAnnotation in chart, state, box, or function
Stateflow.AtomicBoxAtomic box in chart, state, box, or function
Stateflow.AtomicSubchartAtomic subchart in chart, state, or box
Stateflow.BoxBox in chart, state, box, or function
Stateflow.EMFunctionMATLAB function in chart, state, box, or function
Stateflow.FunctionGraphical function in chart, state, box, or function
Stateflow.JunctionConnective or history junction in chart, state, box, or function
Stateflow.PortEntry or exit port in state or atomic subchart
Stateflow.SimulinkBasedStateSimulink based state in chart, state, or box
Stateflow.SLFunctionSimulink function in chart, state, box, or function
Stateflow.StateState in chart, state, or box
Stateflow.TransitionTransition in chart, state, box, or function
Stateflow.TruthTableTruth table function in chart, state, box, or function

非图形对象

Stateflow.DataData in chart, state, box, or function
Stateflow.EventEvent in chart, state, or box
Stateflow.MessageMessage in chart, state, or box

剪贴板和编辑器对象

Stateflow.ClipboardClipboard to copy and paste Stateflow objects
Stateflow.EditorGraphical aspects of a chart or state transition table

对象函数

全部展开

导航层次结构

findIdentify specified objects in hierarchy
getChildrenIdentify children of object
getParentIdentify parent of object
defaultTransitionsIdentify default transitions in specified object
innerTransitionsIdentify inner transitions with specified source
outerTransitionsIdentify outgoing transitions with specified source
sinkedTransitionsIdentify transitions with specified destination
sourcedTransitionsIdentify transitions with specified source

访问和修改属性

dialogOpen properties dialog box
exportAsStructExport contents of state transition table as structure array
setImageInsert image into annotation
isCommentedDetermine if graphical object is commented out

控制显示

viewDisplay object in editing environment
highlightHighlight graphical object
fitToViewZoom in on graphical object
zoomInZoom in on Stateflow chart
zoomOutZoom out on Stateflow chart

映射原子子图符号

getMappingForSymbolGet mapping for symbol in atomic subchart or box
setMappingForSymbolSet mapping for symbol in atomic subchart or box
clearMappingForSymbolClear mapping for symbol in atomic subchart or box
disableMappingForSymbolDisable input event in atomic subchart or box

复制和粘贴对象

copyCopy array of objects to clipboard
pasteToPaste objects in clipboard to specified container object

主题