Main Content

convertToSTT

Convert Stateflow chart to state transition table

Since R2023b

Description

example

stth = convertToSTT(chart) converts the unlocked Stateflow® chart chart to a state transition table.

Examples

collapse all

This example shows how to convert a Stateflow® chart to a state transition table.

Open the example model and access the Stateflow.Chart object.

load_system("convertToSTTModel.slx")
ch = find(sfroot,"-isa","Stateflow.Chart");

Convert the chart to a state transition table.

convertedSTT = ch.convertToSTT
convertedSTT = 
  StateTransitionTableChart with properties:

                                          Path: 'convertToSTTModel/State Transition Table'
                                       Machine: [1x1 Stateflow.Machine]
                                     StateFont: [1x1 Stateflow.STTStateFont]
                                TransitionFont: [1x1 Stateflow.STTTransFont]
                                         Debug: [1x1 Stateflow.ChartDebug]
                                ActionLanguage: 'MATLAB'
                                    ChartColor: [1 0.9608 0.8824]
                        ConstantFoldingTimeOut: 40000
                       DerivativesFormatString: '$N_dot'
                              EmlDefaultFimath: 'Same as MATLAB Default'
                       FimathForFiConstructors: 'Same as FIMATH for fixed-point input signals'
                                  EnableBitOps: 0
                       EnableNonTerminalStates: 0
                           EnableZeroCrossings: 1
                                  EnumTypeName: 'State_Transition_TableModeType'
                       ExecuteAtInitialization: 0
                                    ErrorColor: [1 0 0]
                          ExportChartFunctions: 0
                              InitializeOutput: 0
                                   InputFimath: 'fimath(......'
                                 JunctionColor: [0.6824 0.3294 0]
                     NoCodegenForCustomTargets: 0
                          NonTerminalMaxCounts: 1000
                                    OutputData: []
                               RequirementInfo: ''
                     SaturateOnIntegerOverflow: 1
                                    StateColor: [0 0 0]
                               StateLabelColor: [0 0 0]
                                SelectionColor: [1 0 0.5176]
                               TransitionColor: [0.2902 0.3294 0.6039]
                          TransitionLabelColor: [0.2902 0.3294 0.6039]
              TreatUndefinedSymbolsAsExtrinsic: 0
                                     TreatAsFi: 'Fixed-point'
    UserSpecifiedStateTransitionExecutionOrder: 1
                                       Visible: 0
                                 HasOutputData: 0
                          OutputMonitoringMode: 'ChildActivity'
                   StateActivityOutputDataType: 'Enum'
                              StateMachineType: 'Classic'
                                        Editor: [1x1 Stateflow.Editor]
                                 Decomposition: 'EXCLUSIVE_OR'
                   NonTerminalUnstableBehavior: 'Proceed'
                                          Name: 'State Transition Table'
                                    SampleTime: '-1'
                                hadBreakpoints: 0
                                   Description: ''
                                         Dirty: 1
                                      Document: ''
                                          Iced: 0
                                        Locked: 0
                         SupportVariableSizing: 1
          TreatDimensionOfLengthOneAsFixedSize: 1
                                           Tag: []
                                            Id: 156
                                   ChartUpdate: 'INHERITED'
                            StatesWhenEnabling: 'held'
                              PaperOrientation: 'landscape'
                             PaperPositionMode: 'auto'
                                 PaperPosition: [2.2361 2.9861 6.5278 2.5278]
                                     PaperSize: [11 8.5000]
                                    PaperUnits: 'inches'
                                     PaperType: 'usletter'
                             TiledPaperMargins: [0.5000 0.5000 0.5000 0.5000]
                                TiledPageScale: 1
                            ShowPageBoundaries: 'off'

Input Arguments

collapse all

Stateflow chart to convert, specified as a Stateflow.Chart object.

Limitations

  • Charts that contain super-transitions are not supported.

  • Chart must be at the top level of the Simulink® model.

  • Chart may not include variant transitions.

Version History

Introduced in R2023b