Update Model blocks to reflect changes to referenced models
This example shows what happens when you refresh a Model block after adding a port to the referenced model.
Open the top model and load the referenced model.
Add an input port to the referenced model. Because the referenced model already has a block named Inport, use the
MakeNameUnique option to ensure that the new block name is unique.
add_block('simulink/Ports & Subsystems/In1',... 'RefreshModelBlockMdlRef/Inport','MakeNameUnique','on');
Refresh one of the Model blocks.
The refreshed Model block shows the port you added, while the other Model block does not.
modelBlock— Model block to refresh
Model block to refresh, specified as a character vector or a handle.