Main Content

createArchitectureSubsystem

Create architecture subsystem from component

Since R2023a

Description

createArchitectureSubsystem(component,subsystemName) creates an architecture subsystem from the component component that references the subsystem subsystemName.

Note

Components with physical ports cannot be saved as architecture models, model references, software architectures, or Stateflow® chart behaviors. Components with physical ports can only be saved as subsystem references or as subsystem component behaviors.

example

Examples

collapse all

Save the component robotComp in the RobotSubsystem.slx subsystem and reference the subsystem.

Create a model named archModel.slx.

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
arch = get(model,"Architecture");

Add two components to the model electricComp and robotComp. Rearrange the model.

names = ["electricComp","robotComp"];
comp = addComponent(arch,names);
Simulink.BlockDiagram.arrangeSystem("archModel")

Save the robotComp component as an architecture subsystem so the component references the subsystem RobotSubsystem.slx.

createArchitectureSubsystem(comp(2),"RobotSubsystem");

Input Arguments

collapse all

Component, specified as a systemcomposer.arch.Component object. The component must have an architecture with definition type composition. For other definition types, this function gives an error.

Name of subsystem, specified as a character vector or string.

Example: "exMobileRobotSubsystem"

Data Types: char | string

More About

collapse all

Version History

Introduced in R2023a