Reusable library block containing MATLAB Function block input driven by Constant block
2 次查看(过去 30 天)
显示 更早的评论
I created a Simulink library that contains an atomic subsystem configured to be reusable (SYS_MAT). That subsystem contains a Matlab Function.
I created a Simulink subsystem (SYS) that uses the library block (SYS_MAT) as a linked subsystem two times. First instance, it is driven by an input port. Second instance, it is driven by a Constant block. When I try to generate code from the Simulink subsystem (SYS) using Embedded Coder, the reusable library block generates duplicate code i.e. the function is not reused for the two instances of SYS_MAT. It seems that somehow driving the Matlab Function from a Constant block input impacts reusability.
I attached my simple test. To recreate the problem, open code_gen_test_duplication.slx, right click SYS block, C/C++ and build this subsystem. Inspect the code generation report for the dulicated code generation of SYS_MAT.c.
Please advise.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!