possibility to create "Enbaled" subsystem
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jack Daniels
am 14 Jan. 2025
Beantwortet: Divyanshu
am 15 Jan. 2025
Hello all,
I need to create the subsystem which needs to be optionally Enable/Disabled before simulation starts but there si no need to be enabled/disable during the simulation ...
What are the possiblities to create a such subsystem in Simulink?
Thank you very much for your suggestion.
0 Kommentare
Akzeptierte Antwort
Divyanshu
am 15 Jan. 2025
A possible way to create such subsystems in your model is by using 'Variant subsystems'. These subsystems can be activated and deactivated using a condition. For example if (V == 1) then make 'subsystem1' as active else make it inactive.
Thus by specifying the value of control variable 'V' before simulation you can activate the subsystem or inactivate it according to the use-case.
You can read more about Variant Subsystems. Also you can refer this example for better understanding.
And as you mentioned that it has to be activated or deactived before simulation, maybe then you can set the 'Variant Activation Time' parameter of 'Variant Subsystem' block to 'Update Diagram'.
0 Kommentare
Weitere Antworten (1)
Paul
am 15 Jan. 2025
One option would be to create the subsystem as an Enabled subsystem and then control the enable port with a signal that you control from the worksapce (or from however you're injecting data into the simulation) such that the block is either enabled or disabled for the entire simulation. Keep in mind that the block outputs are still going to be generated for the entire simulation.
Another option would be to not use an Enabled subsystem and instead use a call to set_param to set the Commented property of the subsystem to the behavior you want ('off', 'on', or 'through'). I believe that toggling this parameter is a structural change and so will cause the simulation to be rebuilt/recompiled when that parameter changes.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Component-Based Modeling finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!