Include comments - Comments in generated code - MATLAB (original) (raw)

Main Content

Comments in generated code

Description

App Configuration Pane: Code Appearance

Configuration Objects: coder.MexCodeConfig | coder.CodeConfig | coder.EmbeddedCodeConfig

Specify whether to place comments in the generated files.

If you enable this parameter, the code generator places default comments, such as inferred argument types, in the generated code. The code generator also copies code comments that you make inside your MATLABĀ® functions into the generated code, with some exceptions. For example, the generated code generally does not include code comments from MATLAB functions that are removed due to internal optimizations.

If you generate code for a live function (.mlx file), the code generator does not include the text sections in the generated code, even if you enableInclude Comments. To include live function text sections as comments in the generated code, first save the .mlx file as a.m file, which converts the text sections to code comments within the function body. Because the code generator gives precedence to functions in.mlx files over those in .m files, you must rename one of the functions or move one of the files to a different folder. Then, generate code for the function in the .m file. The code generator includes the text sections as comments in the generated code.

Settings

On

The code generator includes comments in the generated code. This value is the default value.

Off

The code generator does not include comments in the generated code.

Programmatic Use

**Property:**GenerateComments
Values: true |false
Default: true

Version History

Introduced in R2011a