Main Content

coder.Message Properties

Description of message produced during code generation

The coder.Message properties contain the description of an error, warning, or informational message that is produced during code generation from MATLAB® code. All coder.Message properties are read-only. You can use dot notation to query these properties.

You do not directly create a coder.Message object. A coder.ReportInfo object contains one coder.Message object for every message produced during code generation. These coder.Message objects are automatically created when you export code generation report information to a coder.ReportInfo object. For more information, see coder.ReportInfo Properties and Access Code Generation Report Information Programmatically.

This property is read-only.

The identifier associated with a message produced during code generation from MATLAB code, specified as a character vector.

Example: 'Coder:toolbox:unsupportedClass'

Data Types: char

This property is read-only.

The type of a message produced during code generation from MATLAB code, specified as one of the values in this table.

ValueDescription
'Error'

Error message

'Warn'

Warning message

'Info'

Informational message

Data Types: char

This property is read-only.

The text of a message produced during code generation from MATLAB code, specified as a character vector.

Example: 'Function 'svd' is not defined for values of class 'string'.'

Data Types: char

This property is read-only.

Category of a message about potential issues with the generated code, specified as one of the values in this table. These messages also appear in the code generation report Code Insights tab.

ValueDescription
'PotentialDifferencesFromMATLAB'

Potential difference in behavior of the generated code from MATLAB code

'DataTypeIssues'

Potential data type issues

'RowMajorIssues'

Potential inefficiencies caused by array layout

'GpuDiagnostics'

Potential graphics processing unit (GPU) issues. This value is applicable only if you have GPU Coder™.

Data Types: char

This property is read-only.

The 'GpuDiagnostics' category provides information that you can use to troubleshoot code generation issues, improve code execution time, and reduce memory usage of generated code. This property is applicable only if you have GPU Coder.

Data Types: char

This property is read-only.

A description of the MATLAB file that contains code that caused the message.

This property is read-only.

1-based index of the first character of the part of the file text that caused the message. If the file does not contain text (for example, a P-coded file), this property is equal to 0.

To manually inspect the code, the line and column numbers corresponding to StartIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

This property is read-only.

1-based index of the last character of the part of the file text that caused the message. If the file does not contain text (for example, a P-coded file), this property is equal to 0.

To manually inspect the code, the line and column numbers corresponding to EndIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

Introduced in R2019a