addVariantComponent

Add a component to the architecture

Description

variantList = addVariantComponent(architecture,variantComponents) adds a set of components specified by the array of names.

variantList = addVariantComponent(architecture,variantComponents,'Position',position) creates a variant component the architecture at a given position.

Examples

collapse all

Create model, get root architecture, and create a component with two variants.

model = systemcomposer.createModel('archModel');
arch = get(model,'Architecture');
names = {'Component1','Component2'}
variants = addVariantComponent(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 variant component.

Data Types: string

The array denotes the top corner of the component in terms of its x and y coordinates followed by the x and y coordinates of the bottom corner. When adding more than one variant component, a matrix of size [NX4] may be specified where N is the number of variant components being added.

Data Types: double

Output Arguments

collapse all

Array of variant components. This array is the same size as variantComponents.

See Also

|

Introduced in R2019a