Code Generation Readiness Tool

What Information Does the Code Generation Readiness Tool Provide?

The code generation readiness tool screens MATLAB® code for features and functions that are not supported for code generation. The tool provides a report that lists the source files that contain unsupported features and functions. The report also provides an indication of how much work you must do to make the MATLAB code suitable for code generation. The tool might not detect all code generation issues. Under certain circumstances, it might report false errors. Because the tool might not detect all issues, or might report false errors, generate a MEX function to verify that your code is suitable for code generation before generating C code.

Summary Tab

The Summary tab provides a Code Generation Readiness Score which ranges from 1 to 5. A score of 1 indicates that the tool has detected issues that require extensive changes to the MATLAB code to make it suitable for code generation. A score of 5 indicates that the tool has not detected code generation issues; the code is ready to use with no or minimal changes.

On this tab, the tool also provides information about:

  • MATLAB syntax issues. These issues are reported in the MATLAB editor. Use the code analyzer to learn more about the issues and how to fix them.

  • Unsupported MATLAB function calls.

  • Unsupported MATLAB language features, such as recursion, cell arrays, and nested functions.

  • Unsupported data types.

Code Structure Tab

If the code that you are checking calls other MATLAB functions, or you are checking multiple entry-point functions, the tool displays the Code Structure Tab.

This tab provides information about the relative size of each file and how suitable each file is for code generation.

Code Distribution

The Code Distribution pane provides a pie chart that shows the relative sizes of the files and how suitable each file is for code generation. This information is useful during the planning phase of a project for estimation and scheduling purposes. If the report indicates that there are multiple files not yet suitable for code generation, consider fixing files that require minor changes before addressing files with significant issues.

Call Tree

The Call Tree pane provides information on the nesting of function calls. For each called function, the report provides a Code Generation Readiness score which ranges from 1 to 5. A score of 1 indicates that the tool has detected issues that require extensive changes to the MATLAB code to make it suitable for code generation. A score of 5 indicates that the tool has not detected code generation issues; the code is ready to use with no or minimal changes. The report also lists the number of lines of code in each file.

Show MATLAB Functions.  If you select Show MATLAB Functions, the report also lists the MATLAB functions called by your function code. For each of these MATLAB functions, if the function is supported for code generation, the report sets Code Generation Readiness to Yes.

Was this topic helpful?