MATLAB: How to put a subsystem block in the custom library without it acting like a sub-library or group

blockcustomdraggrouplibrarymasksimulinksub-librarysublibrarysubsystem

I am creating a custom library, and I would like to have a subsystem block in it. When I create the library, the subsystem block appears as a group of the elements within the subsystem (see the image named "SublibraryBlock"), but I would like to work like a drag-and-drop block you would find in a typical Simulink library (see the image named "SubsystemBlock").

Best Answer

The subsystem appearing as a group, or sub-library, is intentional. Subsystems can be used to create sub-libraries in custom libraries. To make to subsystem work like a typical drag-and-drop block and not like a sub-library, create a mask for the subsystem.
To learn more about creating masks, see this documentation page:
https://www.mathworks.com/help/simulink/gui/mask-editor-overview.html. 
Note that the mask must include some kind of modification on the "Parameters & Dialog" tab of the Mask Editor. Just changing the mask icon will not make the subsystem work like a drag-and-drop block. When the subsystem's mask is completely created and the subsystem is added to the custom library, it will work like a typical drag-and-drop block in a library.