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.

Simulink® 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, Simulink 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 a positive integer that is a power of 2, not exceeding 128. Specify an integer number of double data type. See Data Alignment for Code Replacement (Embedded Coder) for more information.

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 Apply Custom Storage Classes to Individual Signal, State, and Parameter Data Elements (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 Apply Storage Classes to Individual Signal, State, and Parameter Data Elements (Simulink Coder).

Example: 'ExportedGlobal'

Data Types: char

Examples

collapse all

For examples that show how to configure code generation settings for a data item programmatically, see Apply Storage Classes to Individual Signal, State, and Parameter Data Elements (Simulink Coder) and Apply Custom Storage Classes to Individual Signal, State, and Parameter Data Elements (Embedded Coder).

Introduced in R2015a