How do I refresh "Model" blocks programmatically?

43 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Jul 2023
Edited: MathWorks Support Team on 5 Jul 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:

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!