![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1398344/image.jpeg)
how to disable Stateflow object eliminated by optimization while code generation ?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have designed a state machine in stateflow. it consists of several variable and states. however, when I am generating codeusing embedded Coder, multiple states and variables are missing from code. on clicking on that particlar state, Stateflow prompts "Stateflow object eliminated by optimization". kindly suggest how to ensure all states and variables are present in the final code as they are in state machine
0 Commenti
Risposte (1)
Saffan
il 30 Mag 2023
To prevent elimination of states or other blocks from generated code by optimization, you need to uncheck Block reduction parameter from Model Configuration Parameters > Simulation Target > Advanced parameters > Block reduction.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1398344/image.jpeg)
Refer to the following link for more information on code generation optimization:
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!