code to replace Variant subsystem in a simulink model with library of its active variant
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a simulink model which has 3 variant subsystems it is run pefectly but for long simulation I am facing with memory outage error. Because of that I want to wirte a code which autmatically replace each variant subsystem with library block of its selected active variant inorder to have a simpler and faster simulation model? Does someone has any writen function or code for this purpose?
Thanks in advance!
0 个评论
回答(1 个)
Dinesh
2024-4-10
Hi Laila,
"Configurable Subsystem" was introduced earlier than "Variant Subsystem". As per my understanding, "Configurable Subsystem" replaces itself with the active choice completely, but "Variant Subsystem" doesn't. However, I wouldn't recommend using "Configurable Subsystem" because it will be deprecated in future versions. Here's the documentation link for the same: https://www.mathworks.com/help/simulink/slref/configurablesubsystem.html
I also have to point out that "Variant Subsystem" has undergone several improvements in the last few years and you might not face these memory issues with the latest release. You can use the "Update Diagram" option for the "Variant Activation Time" in the dialog for Variant Subsystem. This will ensure that only the active variants get compiled and executed. Here's the documentation link for the same: https://www.mathworks.com/help/simulink/slref/variantsubsystemvariantmodelvariantassemblysubsystem.html
I hope this helps.
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!