| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Stateflow |
| Contents | Index |
| Learn more about Stateflow |
This table summarizes what's new in V7.4 (R2009b):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility Considerations, below. See also Summary. | Bug
Reports | Printable Release Notes: PDF |
New features and changes introduced in this version are:
Support for Creating Switch-Case Flow Graphs Using the Pattern Wizard
Improved Panning and Selection of States and Transitions When Using Stateflow Debugger
Stateflow Compilation Status Added to Progress Indicator on Simulink Status Bar
Support for Chart Inputs and Outputs That Vary in Dimension During Simulation
New Compilation Report for Embedded MATLAB Functions in Stateflow Charts
Enhanced Support for Replacing Math Functions with Target-Specific Implementations
Enhanced Context Menu Support for Adding Flow Graph Patterns to Charts
Option to Log Chart Signals Available in the Stateflow Editor
Default Precision Set to Double for Calls to C Math Functions
Charts Closed By Default When Opening Models Saved in Formats of Earlier Versions
You can copy a function-call subsystem from a model and paste directly in the Stateflow® Editor. This enhancement eliminates the steps of manually creating a Simulink function in your chart and pasting the contents of the subsystem into the new function. You can also copy a Simulink function from a chart and paste directly in a model as a function-call subsystem.
For more information, see Using Simulink Functions in Stateflow Charts in the Stateflow and Stateflow Coder User's Guide.
If a flow graph or Embedded MATLAB™ function in your chart uses if-elseif-else decision logic, you can choose to generate switch-case statements during Real-Time Workshop® Embedded Coder™ code generation. Switch-case statements provide more readable and efficient code than if-elseif-else statements when multiple decision branches are possible.
When you load models created in R2009a and earlier, this optimization is off to maintain backward compatibility. In previous versions, if-elseif-else logic appeared unchanged in generated code.
For more information, see:
In the Pattern Wizard, you can now choose to create a flow graph with switch-case decision logic. For more information, see Modeling Logic Patterns and Iterative Loops Using Flow Graphs in the Stateflow and Stateflow Coder User's Guide.
You can now use more than 254 events in a chart. The previous limit of 254 events no longer applies. This enhancement supports large-scale models with charts that send and receive hundreds of events during simulation. Although Stateflow software does not limit the number of events, the underlying C compiler enforces a theoretical limit of (2^31)-1 events for the generated code.
For more information, see Defining Events in the Stateflow and Stateflow Coder User's Guide.
During single-step mode, the Stateflow Debugger no longer zooms automatically to the chart object that is executing. Instead, the debugger opens the subviewer that contains that object. This enhancement minimizes visual disruptions as you step through your analysis of a simulation.
For more information, see Options to Control Execution Rate in the Debugging Window in the Stateflow and Stateflow Coder User's Guide.
For Windows® platforms, messages about Stateflow compilation status now appear on the status bar of the Simulink Model Editor when you update diagram.
Stateflow charts now support input and output data that vary in dimension during simulation. In this release, only Embedded MATLAB functions nested in the charts can manipulate these input and output data.
For more information, see Using Variable-Size Data in Stateflow Charts and Working with Variable-Size Data in Embedded MATLAB Functions in the Stateflow and Stateflow Coder User's Guide.
The new compilation report provides compile-time type information for the variables and expressions in your Embedded MATLAB functions. This information helps you find the sources of error messages and understand type propagation issues, particularly for fixed-point data types. For more information, see Working with Compilation Reports in the Simulink User's Guide.
The new compilation report is not supported by the MATLAB internal browser on Sun™ Solaris™ 64-bit platforms. To view the compilation report on Sun Solaris 64-bit platforms, you must have your MATLAB Web preferences configured to use an external browser, for example, Mozilla® Firefox®. To learn how to configure your MATLAB Web preferences, see Web Preferences in the MATLAB documentation.
You can now replace the following math functions with target-specific implementations:
| Function | Data Type Support |
|---|---|
| atan2 | Floating-point |
| fmod | Floating-point |
| ldexp | Floating-point |
| max | Floating-point and integer |
| min | Floating-point and integer |
Replacement of abs now works for both floating-point and integer arguments. Previously, replacement of abs with a target function worked only for floating-point arguments.
For more information about Target Function Libraries, see:
Example: Mapping Math Functions to Target-Specific Implementations
Replacement of C Math Library Functions with Target-Specific Implementations
In the Stateflow Editor, you can now right-click at any level of the chart hierarchy (for example, states and subcharts) to insert flow graphs using the Patterns context menu. Previously, options in this context menu were available only if you right-clicked at the chart level.
To log chart signals, you can select Tools > Log Chart Signals in the Stateflow Editor. Previously, you had to right-click the Stateflow block in the Model Editor to open the Signal Logging dialog box.
For more information, see Logging Chart Signals Using the Signal Logging Dialog Box in the Stateflow and Stateflow Coder User's Guide.
When you call C math functions, such as sin, exp, or pow, double precision applies unless the first input argument is explicitly single precision. For example, if you call the sin function with an integer argument, a cast of the input argument to a floating-point number of type double replaces the original argument. This behavior ensures consistent results between Simulink blocks and Stateflow charts for calls to C math functions.
To force a call to a single-precision version of a C math function, you must explicitly cast the function argument using the single cast operator. This method works only when a single-precision version of the function exists in the selected Target Function Library as it would in the 'C99 (ISO)' Target Function Library. For more information, see Calling C Functions in Actions and Type Cast Operations in the Stateflow and Stateflow Coder User's Guide.
In the Data properties dialog box, the Lock output scaling against changes by the autoscaling tool check box is now Lock data type setting against changes by the fixed-point tools. Previously, this check box was visible only if you entered an expression or a fixed-point data type, such as fixdt(1,16,0). This check box is now visible for any data type specification. This enhancement enables you to lock the current data type settings on the dialog box against changes that the Fixed-Point Advisor or Fixed-Point Tool chooses.
For more information, see Fixed-Point Data Properties and Automatic Scaling of Stateflow Fixed-Point Data in the Stateflow and Stateflow Coder User's Guide.
If you save a model with Stateflow charts in the format of an earlier version, the charts appear closed when you open the new MDL-file.
The following demo has been added in R2009b:
| Demo... | Shows how you can... |
|---|---|
| sf_aircraft | Design a fault detection, isolation, and recovery (FDIR) application for a pair of aircraft elevators with redundant actuators |
The following demo has been enhanced in R2009b:
| Demo... | Now... |
|---|---|
| sldemo_fuelsys | Uses enumerated data types and Simulink functions in the Stateflow chart to model control logic for the fuel rate control system |
![]() | Stateflow and Stateflow Coder Release Notes | Version 7.3 (R2009a) Stateflow and Stateflow Coder Software | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |