Return variant control on choice within variant component
expression = getCondition(variantComponent,choice)
example
expression = getCondition(variantComponent,choice) returns the variant control on the choice within the variant component.
expression
variantComponent
choice
collapse all
Create a model, get the root architecture, create on variant component, add two choices for the variant component, set the active variant choice, set a condition, and get the condition.
model = systemcomposer.createModel('archModel'); arch = get(model,'Architecture'); mode = 1; variant = addVariantComponent(arch,'Component1'); compList = addChoice(variant,{'Choice1','Choice2'}); setActiveChoice(variant,compList(2)); setCondition(variant,compList(2),'mode == 2'); exp = getCondition(variant,compList(2))
exp = 'mode == 2'
Architecture component, specified as a systemcomposer.arch.VariantComponent object. This component contains multiple choices.
systemcomposer.arch.VariantComponent
Choice in variant component whose control string is returned by this function, specified by a systemcomposer.arch.Component object.
systemcomposer.arch.Component
Control string that controls the selection of the particular choice, returned as a character vector.
Data Types: char
char
addVariantComponent | makeVariant | setActiveChoice | setCondition
addVariantComponent
makeVariant
setActiveChoice
setCondition