Code Generation Reports
When you enable report generation or an error occurs,
generates a code generation report. Use the report to debug your MATLAB® functions and verify that they are suitable for code generation. The report
provides type information for the variables and expressions in your functions. This
information helps you to find sources of error messages and to understand type propagation
To control generation and opening of the report, use
To generate a report, use the
To generate and open a report, use the
Alternatively, use configuration object properties:
To generate a report, set
If you want
fiaccelto open the report for you, set
The code generation report is named
report.mldatx. It is located in
html subfolder of the code generation output folder. If you have
MATLAB R2018a or later, you can open the
report.mldatx file by
Errors and Warnings
View code generation error, warning, and information messages on the All Messages tab. To highlight the source code for an error or warning, click the message. It is a best practice to address the first message because subsequent errors and warnings can be related to the first message.
Files and Functions
In the MATLAB Source pane, the Function List view organizes functions according to the containing file. To visualize functions according to the call structure, use the Call Tree view.
To view a function in the code pane of the report, click the function in the list. Clicking a function opens the file that contains the function. To edit the selected file in the MATLAB Editor, click Edit in MATLAB or click a line number in the code pane.
Specialized Functions or Classes
When a function is called with different types of inputs or a class uses different types for its properties, the code generator produces specializations. In the MATLAB Source pane, numbered functions (or classes) indicate specializations. For example:
To view a MATLAB function in the code pane, click the name of the function in the MATLAB Source pane. In the code pane, when you pause on a variable or expression, a tooltip displays information about its size, type, and complexity. Additionally, syntax highlighting helps you to identify MATLAB syntax elements and certain code generation attributes, such as whether a function is extrinsic or whether an argument is constant.
The report identifies an extrinsic function with purple text. The tooltip indicates that the function is extrinsic.
Orange text indicates a compile-time constant argument to an entry-point function or a specialized function. The tooltip includes the constant value.
Knowing the value of a constant argument helps you to understand the generated function signatures. It also helps you to see when code generation creates function specializations for different constant argument values.
To export the value to a variable in the workspace, click the Export icon .
The Variables tab provides information about the variables for the selected MATLAB function. To select a function, click the function in the MATLAB Source pane.
The variables table shows:
Class, size, and complexity
Properties of fixed-point types
This information helps you to understand type propagation and identify type mismatch errors.
Visual Indicators on the Variables Tab
This table describes the symbols, badges, and other indicators in the variables table.
|Column in the Variables Table||Indicator||Description|
|Name||expander||Variable has elements or properties that you can see by clicking the expander.|
|Name||Homogenous cell array (all elements have the same properties).|
|Size||Variable-size array with an upper bound of
|Size||Variable-size array with no upper bound.|
|Size||italics||Variable-size array whose dimensions do not change size during execution.|
To see the fixed-point properties, click the badge.
If you enable potential differences reporting, you can view the messages on the Code Insights tab. The report includes potential differences messages only if you enabled potential differences reporting. See Potential Differences Reporting.