How do I refresh "Model" blocks programmatically?

29 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 27 Juin 2009
I have a Simulink model with many "Model" blocks. I have to frequently refresh each of these blocks by right-clicking on the block, hovering over "Subsystem & Model Reference", and then clicking on "Refresh Selected Model Block". Is there a way I can update "Model" blocks programmatically?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 5 Juil 2023
Modifié(e) : MathWorks Support Team le 5 Juil 2023
MATLAB R2020a and later:
You can use the "Simulink.ModelReference.refresh" function to update a specified "Model" block. Please refer to the following documentation page for more information:
MATLAB R2019b and earlier:
You can save the referenced model by using the "save_system" function. Please refer to the following documentation page for more information:

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by