Main Content

addComponent

Add components to architecture

Description

example

components = addComponent(architecture,compNames) adds a set of components specified by the array of names.

components = addComponent(architecture,compNames,stereotypes) applies stereotypes specified in the stereotypes to the new components.

Examples

collapse all

Create a model, get the root architecture, and create components.

model = systemcomposer.createModel('archModel');
arch = get(model,'Architecture');
names = {'Component1','Component2'};
comp = addComponent(arch,names);

Input Arguments

collapse all

Parent architecture to which component is added, specified as a systemcomposer.arch.Architecture object.

Name of components, specified as a cell array of character vectors. The length of compNames must be the same as stereotypes.

Data Types: char

Stereotypes to apply to components, specified as a cell array of character vectors. Each element is the fully qualified stereotype name for the corresponding component in the form '<profile>.<stereotype>'.

Data Types: char

Output Arguments

collapse all

Created components, returned as a cell array of systemcomposer.arch.Component objects.

See Also

|

Introduced in R2019a