How to prevent simulink from generating code containing erroneous unused variables?
显示 更早的评论
Simulink is generating an unused variable in the model init code for models that include a foreach loop. This is causing issues when we link using gcc, as we don't want any warnings for our compiled product. I'm not sure if we're defining the foreach logic incorrectly or if there is a setting we could tweak to fix this issue.
Has this issue been seen before and is there any known solutions for it?
variable is of the form:
int32_T ForEach_itr;
1 个评论
Noufal Thangal
2026-11-3,18:51
Inside the for-each subsystem add Signal conversion block at inports. This will avoid Matlab from generating unnecessary intialization of for-each variables.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Types 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!