code to replace Variant subsystem in a simulink model with library of its active variant

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!

답변 (1개)

Dinesh
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.

카테고리

도움말 센터File Exchange에서 Component-Based Modeling에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 12월 14일

답변:

2024년 4월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by