%#codegen (pragma)
R2026bPragma that Indicates a MATLAB function is intended for code generation
Syntax
Description
%#codegen is a function-level pragma that instructs the MATLAB® Code Analyzer to report warnings and errors specific to code generation. Use
this pragma in functions for which you intend to generate code.
Examples
Tips
You do not need to add the
%#codegenpragma to functions in a MATLAB Function (Simulink) block. The Code Analyzer always reports warnings and errors specific to code generation for code in a MATLAB Function block.For a list of the checks performed by the Code Analyzer when you add the
%#codegenpragma, see MATLAB for Code Generation Messages.
Version History
Introduced in R2012b