Mask Initialization Commands in Generated Code
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have some masked subsystem(s)( suppose a look up table) in my model with some mask initialization commands. The initialization commands set table data with a variable name which i couldn't find in the generated code. Is there a way to reflect the initilization commands in the code generated? or how to get that variable to appear in code generation?
5 Commenti
Risposte (2)
TAB
il 10 Dic 2012
Modificato: TAB
il 13 Dic 2012
You can generate comments in the code specific for each block using Block's Description field.
- Write click on block -> Open Block Properties
- Enter the text which you want to be generated as comment for this block in Description field. In your case, enter your initialization variable name or mask initialization commands for this block.
- If the block is a subsystem (in your case it is a masked subsystem), make it atomic to treat it as one unit. Right click on subsystem -> Open Subsystem parameters -> Enable Treat as atomic unit.
- Open Configuration Patameters (Ctrl+E) -> Goto Code Generation > Comments -> Enable fields Include Comments & Simulink block description.
[EDITED 13-Dec-2012]
- Goto Configuration Parameters (Ctrl+E)
- Goto Symbols pane in Code Generation section.
- Set option Generate scalar inlined parameter as to Macros
- Generate the code again.
By default your non-tunable inlined parameters are replaced by their values in generated code. Setting above option will generate these parameters as #define MACRO with their name and this macro will be used in calculations.
0 Commenti
Vedere anche
Categorie
Scopri di più su Subsystems in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!