Add a component to the architecture


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.


collapse all

Create model, get 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 the component is added.

Data Types: systemcomposer.arch.Architecture

Cell array where each element defines the name of a new component. The length of compNames must be the same as stereotypes.

Data Types: string

Array of stereotypes where each element is the qualified stereotype name for the corresponding component in the form '<profileName>.<stereotypeName>'. The length of stereotypes must be the same as compNames.

Data Types: string

Output Arguments

collapse all

Array of created components. This array is the same size as compNames and stereotypes.

See Also


Introduced in R2019a