MATLAB: How to get the path of all the built-in blocks in the in the Simulink Library so I can programmatically add them to the model

baseblocksfindinlibrarysimulink

How do I get the path of all the built-in blocks in the in the Simulink Library so I can programmatically add them to my model? I am trying to add blocks like in ports and out ports using the command line API and I am not sure how to add built-in blocks with the "add_block" command.

Best Answer

The library that contains all the built-in blocks is simply called simulink.slx, so a command like "find_system('simulink')" will return all the blocks in the Simulink library. From here, it is possible to use "add_block" to add any one of them to a Simulink model. All the options for the "find_system" command can be found at the following documentation link: