coder.Message - Description of message produced during code generation readiness analysis or during

  code generation - MATLAB ([original](https://www.mathworks.com/help/coder/ref/coder.message-properties.html)) ([raw](?raw))

Main Content

coder.Message Properties

Description of message produced during code generation readiness analysis or during code generation

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

You do not directly create a coder.Message object. These objects are created as parts of other objects:

These coder.Message objects are automatically created when you export a code generation readiness report or a code generation report to an associated object. For more information, see:

Identifier — Message identifier

character vector

This property is read-only.

The identifier associated with a message, specified as a character vector.

Example: 'Coder:toolbox:unsupportedClass'

Data Types: char

Type — Type of message

'Error' | 'Warn' | 'Info'

This property is read-only.

The type of a message, specified as one of the values in this table.

Value Description
'Error' Error message
'Warn' Warning message
'Info' Informational message

Data Types: char

Text — Text of message

character vector

This property is read-only.

The text of a message, specified as a character vector.

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

Data Types: char

Category — Category of a code insight

'PotentialDifferencesFromMATLAB' | 'DataTypeIssues' | 'RowMajorIssues' | 'GpuDiagnostics'

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.

Value Description
'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

SubCategory — Subcategory of a code insight in the 'GpuDiagnostics' category

'kernelCreation' | 'memory' | 'pragma' | 'designPattern' | 'other'

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

File — MATLAB file containing code that caused the message

coder.CodeFile object | coder.File object

This property is read-only.

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

StartIndex — Start index of code that caused the message

double

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 toStartIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

EndIndex — End index of code that caused the message

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 toEndIndex are useful. Use the getLineColumn function to obtain that information.

Data Types: double

Version History

Introduced in R2019a