Skip to Main Content Skip to Search
Product Documentation

Version 5.0 (R13) Stateflow and Stateflow Coder Software

This table summarizes what's new in V5.0 (R13):

New Features and ChangesVersion Compatibility ConsiderationsFixed Bugs and Known Problems
Yes
Details below
Yes—Details labeled as Compatibility Considerations, below. See also Summary.Bug reports not available

New features and changes introduced in this version are:

Data and Event Handling

Fixed-Point Data

Stateflow software now supports fixed-point data with the following features:

See How Fixed-Point Data Works in Stateflow Charts in the Stateflow documentation.

Matrix Support for Data Inputs and Outputs

You can now use two-dimensional matrices of any type for data with the scope Data input from Simulink or Data output to Simulink.

See Adding Data in the Stateflow documentation.

ml Data Type

You can use a new data type called ml. Data of this type is typed internally with the MATLAB type mxArray. This means that you can assign (store) any type of data available in a Stateflow chart to a data of type ml. This includes any type of data defined in a Stateflow chart or returned from the MATLAB workspace with the ml namespace operator or ml function.

Array and Matrix Support for ml Namespace Operator and Function Call

Stateflow software now supports vector arrays and n-dimensional matrices as arguments and return values for the matlab (ml for short) namespace operator and matlab (ml for short) function call. Before, only scalar data was supported.

Stateflow Charts Allows Up to 254 Events

You can now define up to 254 events per chart. The previous maximum was 127. If your chart has more than 254 events, an error message appears.

New Stateflow API

The new Stateflow API provides programmatic access to Stateflow objects. Through individual MATLAB commands or scripts of commands, you can manipulate Stateflow objects (machines, charts, states, boxes, functions, notes, transitions, junctions, data, events, and targets) to perform actions previously available only through Stateflow graphical interfaces. These actions include constructing new charts from scratch and modifying existing ones.

The Stateflow API provides control for the following Stateflow actions:

This feature is documented in Using the API in the Stateflow API documentation.

Functions and Actions

Any Chart or Library Chart Can Export a Function

Any chart or library chart can now export a graphical function and any other chart or library chart can call it, as long as the caller and the called are both accessible through the same main model.

Trailing F Specifier for Single-Precision Floating-Point Numbers

Stateflow action language now recognizes a trailing F for specifying single-precision floating-point numbers, as in the action statement x = 4.56F;. In Stateflow action language, if a trailing F does not appear with a number, it is assumed to be double-precision. Specifying single-precision numbers allows you to save memory in generated code.

Error on Transition Action Into Junction with Following Condition

Transition actions for transitions into junctions with condition actions that follow as part of a state-to-state path are now flagged by an error. The error indicates that the execution of these actions is in reverse order to the apparent segment order in the chart.

Compatibility Considerations.  You can modify existing code using the workaround documented in the Stateflow documentation.

Code Generation

User Comments Included in Generated Code

You can include comments you enter in the action language of Stateflow charts in generated code for embedded and custom targets. This option is enabled by default.

See Building Targets in the Stateflow documentation.

For-Loops Emitted in Generated Code

The Stateflow code generator detects and emits for-loops when applicable. In previous versions, the code generator always emitted while-loops.

Enhanced Integration with Real-Time Workshop Code Generation Software

The code generated for Stateflow blocks is seamlessly integrated with code generated for other Simulink blocks, leading to more efficient and readable code.

Graphical Function Inlining in Generated Code

Graphical functions with I/O can now be inlined in the generated code. You can specify inlining behavior (auto, force inline, force no inline) for every graphical function via its property dialog box. auto refers to a default mode in which the Stateflow Coder code generation software decides when it is advantageous to inline a graphical function.

Performance Improvements

When possible, Simulink input and output data to a Stateflow chart are made local, reducing RAM size. Whenever possible, these local inputs are conditionally evaluated (via expression folding) resulting in execution speed improvements.

Unnecessary Data Initialization Removed

Unnecessary data initialization statements are now removed from the code generated for graphical functions.

Simple If Statements Optimized

A simple Boolean expression evaluation scheme is used to optimize if statements such as if(1), if(0), if(ON==OFF).

Greater Usability

Undo Operation in the Stateflow Editor

You can undo and redo operations you perform in the Stateflow Editor. When you undo an operation, you reverse the last edit operation you performed. After you undo operations, you can also redo them one-at-a-time. When you place your mouse cursor over the Undo or Redo buttons, the tooltip that appears indicates the nature of the operation to undo or redo.

New Model Report

A new model report is available for making comprehensive reports of Stateflow objects. Make this report in the Stateflow Editor by selecting File > Print Details.

Stateflow Explorer Remembers Its Position and Size

Stateflow Explorer now remembers its position and size across sessions.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS