MATLAB: Duplicating a subsystem within simulink

copysimulinkunique

Hi
Sorry – I'm very new to simulink (we got asked to do a project and I got thrown onto it; I've never used the program before firing it up today) and I am trying to model something that is a very repetative cascaded structure. I obviously don't want to have a flat view of everything where all the instances are unique and visible at the high level, so I created a subsystem. I then dupilcated the subsystem and cascaded that, working my way up to the number of cascaded units I wanted. The question I had though, was it appears as though each of the "copies" of the subsystems I created are self contained unique subsystems, not a duplicate reference to the same sub system so if I want to modify something once, I actually have to do it n times within each of the copies of the subsystem. Obviously I don't want to do that; is there a better way to copy/dupilcate things where I can force it all to reference the same underlying subsystem?
Thanks
Chris

Best Answer

For that, you will need to create a custom-Simulink library and add your block to that library. Then in your current model, insert that block from the library browser. If you make any change to the library block, it will be reflected to add blocks in your current model: https://www.mathworks.com/help/simulink/ug/creating-block-libraries.html