Main Content

Fix Errors Detected at Code Generation Time

When the code generator detects errors or warnings, it automatically generates an error report. The error report describes the issues and provides links to the MATLAB® code with errors.

To fix the errors, modify your MATLAB code to use only those MATLAB features that are supported for code generation. For more information, see Programming Considerations for Code Generation. Choose a debugging strategy for detecting and correcting code generation errors in your MATLAB code. For more information, see Debugging Strategies.

When code generation is complete, the software generates a MEX function that you can use to test your implementation in MATLAB.

If your MATLAB code calls functions on the MATLAB path, unless the code generator determines that these functions should be extrinsic or you declare them to be extrinsic, it attempts to compile these functions. See Resolution of Function Calls for Code Generation. To get detailed diagnostics, add the %#codegen directive to each external function that you want codegen to compile.

See Also