Code Appearance - MATLAB & Simulink (original) (raw)
Main Content
Control identifiers, code style, comments, and function and file banners in generated code
Functions
coder.setupMISRAConfig | Configure parameters to improve generated code compliance with MISRA and AUTOSAR guidelines |
---|
Classes
Topics
File Names
- Customize C/C++ File Names Generated from MATLAB Code
Specify format of C/C++ file names generated from MATLAB code.
Code Style
- Controlling C Code Style
Generateswitch-case
statements instead ofif-elseif-else
statements in C/C++ code generated from MATLAB code. - Specify Indent Style for C/C++ Code
Use K&R or Allman indent style in C/C++ code generated from MATLAB code. - Control Signed Left Shifts in Generated Code
Control whether the code generator replaces multiplications by powers of two with signed, left bitwise shifts in code generated from MATLAB code. - Control Data Type Casts in Generated Code
Specify the data type casting mode, that is, default mode, standards compliant mode, or explicit mode, in C/C++ code generated from MATLAB code. - Generate C/C++ Code with Improved MISRA and AUTOSAR Compliance
Configure code generation parameters to increase the MISRA™ and AUTOSAR compliance of the generated C/C++ code.
Control Data Type Names
- Customize Data Type Replacement
Specify custom data type names in C/C++ code generated from MATLAB code. - Import Custom Data Type Definitions from External Header Files
Specify header file names, which contain custom type definitions, that you want to import.
Code Templates
- Code Generation Template Files for MATLAB Code
A CGT file specifies file and function banners, and comments before code sections in C/C++ code generated from MATLAB code. - Generate Custom File and Function Banners for C/C++ Code
Customize a CGT file to generate your own file and function banners in C/C++ code generated from MATLAB code.