- Create a "custom section" in the code templates using the procedure given in the following documentation page.http://www.mathworks.com/help/ecoder/ug/generate-source-and-header-files-with-a-custom-file-processing-cfp-template.html
- In that custom section, add a comment block with the information which you want to include in the auto-generated code.
- For MATLAB version you can use the following code.
- The SVN revision is a little trickier. There is no direct way to access the revision from the command line, so the SVN command line needs to be used instead.
- Note the presence of the revision number. You can use the FEVAL command in TLC to execute an m-function to call the SVN command and parse out the revision number.
- Alternatively, you can also use the following command to return the data in an XML format which will be easier to parse through.
- To include code generation settings, you can use FEVEL command in TLC to execute an m-function which will have many "get_param" calls to obtain all the code generation parameters of your interest. To know the parameter name, simply right-click and click "What's this?" on the parameters in the "Code Generation" pane of "Model Configuration Parameters". A window will appear with all details of that parameter.