| Contents | Index |
| On this page… |
|---|
These binary operations work with complex operands in the following order of precedence (1 = highest, 3 = lowest). For operations with equal precedence, they evaluate in order from left to right.
| Example | Precedence | Description |
|---|---|---|
a * b | 1 | Multiplication |
a + b | 2 | Addition |
a - b | 2 | Subtraction |
a == b | 3 | Comparison, equality |
a != b | 3 | Comparison, inequality |
Stateflow action language does not support division of complex operands because this operation requires a numerically stable implementation, especially when the base type of the complex data is fixed-point.
To perform complex division, use a MATLAB function, which provides a numerically accurate and stable result. For details, see Performing Complex Division with a MATLAB Function.
These unary operations and actions work with complex operands.
Example | Description |
|---|---|
~a | Unary minus |
!a | Logical NOT |
a++ | Increment |
a-- | Decrement |
These assignment operations work with complex operands.
Example | Description |
|---|---|
a = expression | Simple assignment |
a += expression | Equivalent to a = a + expression |
a -= expression | Equivalent to a = a - expression |
a *= expression | Equivalent to a = a * expression |
![]() | How to Define Complex Data | Using Operators to Handle Complex Numbers | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |