MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
设置变体组件上的活动选择项
setActiveChoice(variantComponent,choice)
setActiveChoice(variantComponent,choice) 设置变体组件上的活动选择项。
variantComponent
choice
示例
全部折叠
创建一个模型,获取根架构,创建一个变体组件,为变体组件添加两个选择项,并设置活动选择项。
model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); setActiveChoice(variant,compList(2));
变体组件,指定为 systemcomposer.arch.VariantComponent 对象。
systemcomposer.arch.VariantComponent
变体组件中的活动选择项,指定为 systemcomposer.arch.Component 对象或变体选择项标签(字符向量或字符串)。
systemcomposer.arch.Component
示例: "Choice2"
"Choice2"
数据类型: char | string
char
string
变体是变体组件中众多结构或行为选择项之一。
在执行分析时,使用变体可快速切换组件的不同架构设计。
变体控制项是控制活动变体选择项的字符串。
以编程方式设置变体控制项,以控制哪个变体处于活动状态。
在 R2019a 中推出
addChoice
addVariantComponent
getActiveChoice
getChoices
getCondition
makeVariant
makeVariantAssembly
setCondition
updatePortsFromChoices
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处