Model Configuration Parameters: Code Style
The Code Generation > Code Style category includes parameters for configuring the appearance of the generated code. These parameters require a Simulink® Coder™ license. Additional parameters for an ERT-based target require an Embedded Coder® license.
You can change the code style, cast expressions, and indentation of your generated code to conform to certain coding standards.
Code style modifications have the following uses:
Enhance the readability and traceability of code
Convey information across files
Enhance the efficiency of the generated code
Allow memory manipulation through type casting
On the Configuration Parameters dialog box, the following configuration parameters are on the Code Generation > Code Style pane.
Parameter | Description |
---|---|
Specify parenthesization style for generated code. | |
Specify whether to preserve order of operands in expressions. | |
Specify whether to preserve empty primary condition expressions in
| |
Specify whether to generate code for | |
Specify whether to include the | |
Specify whether to include the | |
Suppress generation of default cases for Stateflow switch statements if unreachable | Specify whether to generate default cases for switch-case statements in the code for Stateflow® charts. |
Replace multiplications by powers of two with signed bitwise shifts | Specify whether to replace multiplications by powers of two with signed bitwise shifts. |
Specify whether to allow signed right bitwise shifts in the generated C/C++ code. | |
Specify how the code generator casts data types for variables. | |
Specify the container type for arrays in the generated code. Choose
either C-style array or | |
Specify style for the placement of braces in generated code. | |
Specify indent size for generated code. | |
Specify the newline style for generated code. | |
Specify the maximum line width for wrapping the generated code. |