Complex data is data whose value is a complex number. For
example, in a Stateflow® chart in Simulink® model, an input signal with the value
3 + 5i is
complex. See Complex Signals (Simulink).
Add a data object to your chart, as described in Add Stateflow Data.
Set the Complexity property for the data object to
On. For more information, see Complexity.
Specify the name, scope, size, base type, and other properties for the data object, as described in Set Data Properties.
Complex data does not support the scope
Complex data does not support the base types
Use complex data when you model applications in communication systems and digital signal processing. For example, you can use this design pattern to model a frame synchronization algorithm in a communication system:
Use Simulink blocks (such as filters) to process complex signals.
Use charts to implement mode logic for frame synchronization.
Let the charts access complex input and output data so that nested MATLAB® functions can drive the mode logic.
For an example of modeling a frame synchronization algorithm, see Detect Valid Transmission Data by Using Frame Synchronization.
Continuous-time variables of complex type are not supported. For more information, see Store Continuous State Information in Local Variables.
You can define complex data at these levels of the Stateflow hierarchy:
You can use complex data to define:
You can also use complex data as arguments for:
MATLAB functions (see Reuse MATLAB Code by Defining MATLAB Functions)
Truth table functions (see Use Truth Tables to Model Combinatorial Logic)
Graphical functions (see Reuse Logic Patterns by Defining Graphical Functions)
Change detection operators (see Detect Changes in Data Values)
Exported functions do not support complex data as arguments.