MATLAB: Is there a way to automatically replace the Configurable Subsystem blocks in a model with the actual blocks to which they refer in Simulink

configurablesimulinksubsystem

I have a model that contains multiple configurable subsystems. For my final model, I want to replace those blocks with the actual blocks from the library (i.e. hard code the blocks).

Best Answer

The attached function demonstrates how to parse a model for configurable subsystems and replace them with the actual chosen block.
The attached model and library can be used for demonstration. To call the function, use the following command:
replaceconfigurablesubsystems('demo_model')