- For releases prior to R2018b, we provide the error message that you reported ("Simulink Coder does not support models containing Simulink functions that are not called"). This is expected behaviour, as for these MATLAB releases it was a business decision not to support this workflow.
- From R2018b to R2019b, the error message was relaxed to a warning, to allow users generate code even though a Simulink function without a caller was present. However, support for generating function definition was still not incorporated.
- From R2020a onwards, the function definition is generated even though the Simulink function is not called. We still provide the warning message to inform the user.
Why is a function definition not generated for Simulink functions that are not called in Simulink?
7 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-9-14
回答: MathWorks Support Team
2020-9-14
I am trying to generate code for a model that contains a Simulink function that is not called.
In releases prior to R2018b, I am getting the following error in code generation:
"Simulink Coder does not support models containing Simulink functions that are not called"
In some other releases, I have observed that I can generate code but the function definition is not being generated, and I do not get any header file for it.
Is this expected behaviour? How has this evolved through the different MATLAB releases?
采纳的回答
MathWorks Support Team
2020-9-14
Please let me clarify the changes in behaviour below for the different MATLAB releases:
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!