Main Content

Simulink.CoderInfo

Specify information needed to generate code for signal, state, or parameter data

Description

Use a Simulink.CoderInfo object to specify code generation settings for signal, state, and parameter data in a model.

The software creates a Simulink.CoderInfo object for each data object that you create. Data objects represent signal, state, or parameter data. The Simulink.CoderInfo object exists in the CoderInfo property of each data object.

Data objects include objects of these classes:

Use the properties of the Simulink.CoderInfo object to configure the representation of the parent data object in the generated code.

You can set the properties of a Simulink.CoderInfo object through the CoderInfo property or the property dialog box of the parent data object. For example, the following MATLAB® expression sets the StorageClass property of a Simulink.CoderInfo object used by a signal object named mysignal.

mysignal.CoderInfo.StorageClass = 'ExportedGlobal';

Creation

When you create a data object, the software sets the value of the CoderInfo property by creating a Simulink.CoderInfo object. You do not need to create a Simulink.CoderInfo object explicitly.

Properties

expand all

Alternative name for the data in the generated code, specified as a character vector.

Example: 'myOtherName'

Data Types: char

Data alignment boundary for this data, specified as -1 (no data alignment) or a positive integer that is a power of 2. Specify an integer number of double data type. For more information, see Optimize Performance of Memory Access by Using Data Alignment (Embedded Coder).

Before R2024a: Specify a value not exceeding 128.

Example: 8

Data Types: double
Complex Number Support: Yes

Custom storage class attributes of this data, returned as a custom attributes object. You must set the property StorageClass to 'Custom' to enable this property.

Depending on the custom storage class that you apply by using the CustomStorageClass property of the Simulink.CoderInfo object, Simulink® sets the value of this property by creating a custom attributes object. Then, you can set the values of the properties of the custom attributes object. See Organize Parameter Data into a Structure by Using Struct Storage Class (Embedded Coder) for more information.

Custom storage class of this data, specified as a character vector. You must set the property StorageClass to 'Custom' to enable this property.

For a list of valid custom storage classes (Embedded Coder®) when you create the data object from the Simulink package, see Choose Storage Class for Controlling Data Representation in Generated Code (Embedded Coder).

Example: 'ExportToFile'

Data Types: char

Storage class of this data, specified as a character vector. For more information, see C Data Code Interface Configuration for Model Interface Elements (Simulink Coder).

The storage class of a Simulink.Signal object in a model workspace must be 'Auto'.

Example: 'ExportedGlobal'

Data Types: char

Examples

collapse all

For examples that show how to configure code generation settings for a data item programmatically, see C Data Code Interface Configuration for Model Interface Elements (Simulink Coder) and Organize Parameter Data into a Structure by Using Struct Storage Class (Embedded Coder).

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2015a