MATLAB Compiler    

Controlling Comments in Output Code

Use the annotation:type option to include your initial M-file comments and code in your generated C or C++ output. The possible values for type are

Not specifying any annotation type uses the default of all, which includes the complete source of the M-file (comments and code) interleaved with the generated C/C++ source.

The following sections show segments of the generated code from this simple Hello, World example:

Comments Annotation

To include only comments from the source M-file in the generated output, use

This code snippet shows the generated code containing only the comments ("This is the hello ...") in the middle of the routine:

All Annotation

To include both comments and source code from the source M-file in the generated output, use

or do not stipulate the annotation option, thus using the default of all.

This code snippet contains both comments and source code:

No Annotation

To include no source from the initial M-file in the generated output, use

This code snippet shows the generated code without comments and source code:


  Including M-File Information in Compiler Output Controlling #line Directives in Output Code