Documentation

Code Generation Readiness Tool

The code generation readiness tool screens MATLAB®code for features and functions that code generation does not support. The tool provides a report that lists the source files that contain unsupported features and functions. The report also indicates the amount of work required to make the MATLAB code suitable for code generation. It is possible that the tool does not detect all code generation issues. Under certain circumstances, it is possible that the tool can report false errors. Therefore, before you generate C code, verify that your code is suitable for code generation by generating a MEX function.

Summary Tab

TheSummarytab provides aCode Generation Readiness Score, which ranges from1to5. A score of1indicates that the tool detects issues that require extensive changes to the MATLAB code to make it suitable for code generation. A score of5indicates that the tool does not detect code generation issues; the code is ready to use with minimal or no changes.

On this tab, the tool also displays information about:

  • MATLAB syntax issues. These issues are reported in the MATLAB editor. To learn more about the issues and how to fix them, use the Code Analyzer.

  • Unsupported MATLAB function calls.

  • Unsupported MATLAB language features.

  • 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 theCode Structure Tab.

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

Code Distribution

TheCode Distributionpane displays a pie chart that shows the relative sizes of the files and how suitable each file is for code generation. During the planning phase of a project, you can use this information for estimation and scheduling. If the report indicates that multiple files are not suitable for code generation, consider fixing files that require minor changes before addressing files with significant issues.

Call Tree

TheCall Treepane displays information about the nesting of function calls. For each called function, the report provides aCode Generation Readinessscore, which ranges from1to5. A score of1indicates that the tool detects issues that require extensive changes to the MATLAB code to make it suitable for code generation. A score of5indicates that the tool does not detect code generation issues. The code is ready to use with minimal or no changes. The report also lists the number of lines of code in each file.

Show MATLAB Functions.If you selectShow MATLAB Functions, the report also lists the MATLAB functions that your function calls. For each of these MATLAB functions, if code generation supports the function, the report setsCode Generation ReadinesstoYes.

Related Topics

Was this topic helpful?