addVariantComponent

Add variant components to architecture

Description

example

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 component is added, specified as a systemcomposer.arch.Architecture object.

Names of variant components, specified as a cell array of character vectors.

Data Types: char

Vector that specifies location of top corner and bottom corner of component, specified as a 1x4 array. The array denotes the top corner 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

Handles to variant components, returned as an array of systemcomposer.arch.VariantComponent objects. This array is the same size as variantComponents.

Introduced in R2019a