Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Simulink.BlockDiagram.copyContentsToSubSystem - Copy contents of block diagram to empty subsystem

Syntax

Simulink.BlockDiagram.copyContentsToSubSystem(bdiag, subsys)

Description

Simulink.BlockDiagram.copyContentsToSubSystem(bdiag, subsys) copies the contents of the block diagram bdiag to the subsystem subsys. The block diagram and subsystem 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. You can use this function to convert a referenced model derived from an atomic subsystem into an atomic subsystem that is equivalent to the original subsystem.

This function cannot be used if the destination subsystem contains any blocks or signals. Other types of information can exist in the destination subsystem and are not affected by the function. Use Simulink.SubSystem.deleteContents if necessary to empty the subsystem before using Simulink.BlockDiagram.copyContentsToSubSystem.

Inputs

bdiag

Block diagram name or handle

subsys

Subsystem name or handle

Examples

Copy the contents of f14, including all nested subsystems, to an empty subsystem named f14cp that already exists in the model named f16:

% open f14 and f16
open_system('f14');
open_system('f16');

% copy the block diagram f14 to an empty subsystem of f16 named f14cp
Simulink.BlockDiagram.copyContentsToSubSystem('f14', 'f16/f14cp');

% close f14 and f16
close_system('f14', 0);
close_system('f16', 0);

See Also

Simulink.BlockDiagram.deleteContents | Simulink.SubSystem.convertToModelReference | Simulink.SubSystem.copyContentsToBlockDiagram | Simulink.SubSystem.deleteContents

How To

  


Related Products & Applications

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