How to suppress unwanted lines from ert generated code

4 vues (au cours des 30 derniers jours)
TAB
TAB le 10 Août 2011
The header file of my generated code contains unused include statements as #include stdlib.h #include math.h #include stddef.h
Also it has following comments at the end of file
/*
* The generated code includes comments that allow you to trace directly
* back to the appropriate location in the model. The basic format
* is <system>/block_name, where system is the system number (uniquely
* assigned by Simulink) and block_name is the name of the block.
*
* Use the MATLAB hilite_system command to trace the generated code back
* to the model. For example,
*
* hilite_system('<S3>') - opens system 3
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
*
* Here is the system hierarchy for this model
*
* '<Root>' : cmp
* '<S1>' : cmp/Subsystem
* '<S2>' : cmp/Subsystem/Chart
*/
Can anybody have idea how to suppress unwanted lines from generated code.
Thanks.
  4 commentaires
Kaustubha Govind
Kaustubha Govind le 10 Août 2011
Perhaps the above quoted comments can be eliminated by unchecking code-to-model highlighting? This option should be in Real-Time Workshop>Report pane.
TAB
TAB le 11 Août 2011
I think 'code-to-model' option generates hyperlinks in the generated report. These links refer the block in the model.
It does not suppress the comment in the code.

Connectez-vous pour commenter.

Réponse acceptée

Desiree
Desiree le 10 Août 2011
If it is possible for you to upgrade your MATLAB version to R2009b or higher you probably will not have any problems with the unnecessary includes. The only workaround in older versions as R2007a would be to use a PostCodeGenCommand.
The comment will not be removed when you uncheck the code-to-model highlighting. If you would like to get rid of the comment once and for all but do not want to disable all comments you could simply remove this from the corresponding TLC file:
$MATLABROOT$\rtw\c\tlc\mw\commonhdrlib.tlc (lines 749-804)

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by