Main Content

Structure Definition for Code Generation

To generate efficient standalone code for structures, you must define and use structures differently than you normally would when running your code in the MATLAB® environment:

What's DifferentMore Information
Use a restricted set of operations.Structure Operations Allowed for Code Generation
Observe restrictions on properties and values of scalar structures.Define Scalar Structures for Code Generation
Make structures uniform in arrays.Define Arrays of Structures for Code Generation
Reference structure fields individually during indexing.Index Substructures and Fields
Avoid type mismatch when assigning values to structures and fields.Assign Values to Structures and Fields