Main Content

Code Verification

Behavioral verification of generated code, traceability, code generation reports

After you generate code, inspect the source code and output results for verification purposes. The code generation report provides an interactive interface for inspecting the generated C/C++ source files, generated data types, and other code insights. Access a subset of information from the code generation report programmatically by using the report information object. You can test the output of generated MEX code against the original MATLAB®code, or you can create custom tests based on the MATLAB unit test classes. You can choose to generate run-time error checks that alert you to errors that occur during code execution.

Functions

codegen Generate C/C++ code fromMATLABcode
coder.config CreateMATLABCodercode generation configuration objects
coder.runTest Run test replacing calls toMATLABfunctions with calls to MEX functions
getLineColumn Find locations of beginning and end ofMATLABcode involved in code generation
coder.ignoreConst Prevent use of constant value of expression for function specializations
coder.ignoreSize Prevent code generator from creating function specializations for constant-size expressions
coder.mfunctionname Name of calling function or method

Classes

coder.HardwareImplementation Hardware-specific configuration parameters for C/C++ code generation fromMATLABcode

Objects

coder.MexCodeConfig Configuration parameters for MEX function generation fromMATLABcode
coder.CodeConfig Configuration parameters for C/C++ code generation fromMATLABcode
coder.EmbeddedCodeConfig Configuration parameters for C/C++ code generation fromMATLABcode with嵌入式编码器

Properties

coder.ReportInfo Properties Code generation report information
coder.Summary Properties Summary of code generation fromMATLABcode
coder.File Properties Description of file without text that is involved in code generation
coder.CodeFile Properties Description of file containing text that is involved in code generation
coder.Function Properties Description ofMATLABfunction used in code generation
coder.Method Properties Description of method in aMATLABclass used in code generation
coder.Message Properties Description of message produced during code generation readiness analysis or during code generation
coder.BuildLog Properties Build logs produced during code generation

Topics

Code Generation Reports

Testing Generated Code

Run-Time Error Detection

Troubleshooting