MATLAB® Coder™ supports code generation for structures with a set of restrictions on the operations, the properties of values of scalar structures, and the structure arrays. You can generate code for scalar structures as well as structure arrays. Adhere to restrictions for indexing and assigning values to substructures and fields. Structure arguments are passed by reference or by value in generated code.
|Name C structure type in generated code|
- Structure Definition for Code Generation
Use structures in MATLAB code intended for code generation.
- Structure Operations Allowed for Code Generation
Use structure operations that code generation supports.
- Define Scalar Structures for Code Generation
Adhere to code generation restrictions for scalar structures.
- Define Arrays of Structures for Code Generation
Adhere to code generation restrictions for arrays of structures.
- Index Substructures and Fields
Adhere to code generation restrictions for indexing substructures and fields.
- Assign Values to Structures and Fields
Adhere to code generation restrictions for assigning values to structures and fields.
- Pass Structure Arguments by Reference or by Value in Generated Code
Control whether structure arguments are passed by reference or by value.
- Name the C Structure Type to Use With a Global Structure Variable
coder.cstructnameto define a type object for a global structure.