DocumentationHelp Center
Set active choice on variant component
setActiveChoice(variantComponent,choice)
example
setActiveChoice(variantComponent,choice) sets the active choice on the variant component.
variantComponent
choice
collapse all
Create a model, get the root architecture, create one variant component, add two choices for the variant component, and set the active choice.
model = systemcomposer.createModel('archModel'); arch = get(model,'Architecture'); variant = addVariantComponent(arch,'Component1'); compList = addChoice(variant,{'Choice1','Choice2'}); setActiveChoice(variant,compList(2));
Architecture component, specified as a systemcomposer.arch.VariantComponent object with multiple choices.
systemcomposer.arch.VariantComponent
Active choice in a variant component, specified as a systemcomposer.arch.Component object or label of the variant choice as a character vector.
systemcomposer.arch.Component
addChoice | addVariantComponent | getActiveChoice | getChoices
addChoice
addVariantComponent
getActiveChoice
getChoices
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office
立即获取试用版