| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Simulink.SubSystem.copyContentsToBlockDiagram(subsys, bdiag)
Simulink.SubSystem.copyContentsToBlockDiagram(subsys, bdiag) copies the contents of the subsystem subsys to the block diagram bdiag. The subsystem and block diagram must have already been loaded. The subsystem cannot be part of the block diagram. The function affects only blocks, lines, and annotations; it does not affect nongraphical information such as configuration sets.
This function cannot be used if the destination block diagram contains any blocks or signals. Other types of information can exist in the destination block diagram and are unaffected by the function. Use Simulink.BlockDiagram.deleteContents if necessary to empty the block diagram before using Simulink.SubSystem.copyContentsToBlockDiagram.
subsys |
Subsystem name or handle |
bdiag |
Block diagram name or handle |
Copy the graphical contents of f14/Controller, including all nested subsystems, to a new block diagram:
% open f14
open_system('f14');
% create a new model
newbd = new_system;
open_system(newbd);
% copy the subsystem
Simulink.SubSystem.copyContentsToBlockDiagram('f14/Controller', newbd);
% close f14 and the new model
close_system('f14', 0);
close_system(newbd, 0);
Simulink.BlockDiagram.copyContentsToSubSystem | Simulink.BlockDiagram.deleteContents | Simulink.SubSystem.convertToModelReference | Simulink.SubSystem.deleteContents
![]() | Simulink.SubSystem.convertToModelReference | Simulink.SubSystem.deleteContents | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |