Main Content
Data Definition
How defining data for code generation differs from defining data for
MATLAB®
MATLAB is a dynamically typed language. Therefore, the class, size, and complexity of a given variable can change during MATLAB execution. In contrast, statically typed languages, such as C/C++, must determine variable types at compile-time.
Control how data is represented, memory is allocated, and which C types are used in generated code by how you design your MATLAB code. Follow the described guidelines to allow the code generator to determine the types of variables when generating code.
Data Definition Basics
- Data Definition Considerations for Code Generation
- Best Practices for Defining Variables for C/C++ Code Generation
- Reuse the Same Variable with Different Properties
- Eliminate Redundant Copies of Variables in Generated Code
- Array Size Restrictions for Code Generation
- Code Generation for Constants in Structures and Arrays
- Generate Code for Growing Arrays and Cell Arrays with end + 1 Indexing
Categories
- Numeric Types
Numeric type data and variables for code generation
- Array Layout
Column-major and row-major order for array storage
- Characters and Strings
Code generation for text
- Variable-Size Data
Definition, differences for code generation, dynamic memory allocation
- Structures
Code generation for structures
- Cell Arrays
Code generation for cell arrays
- Tables
Code generation for tables
- Categorical Arrays
Code generation for categorical arrays
- Datetime Arrays
Code generation for datetime arrays
- Duration Arrays
Code generation for duration arrays
- Timetables
Code generation for timetables
- Enumerations
Code generation for enumerations
- MATLAB Classes
Code generation for MATLAB Classes
- Function Handles
Code generation for function handles
- Dictionaries
Code generation for dictionaries
- Deep Learning Arrays
Code generation for deep learning arrays