设置属性值audioplayer
对象
集(
obj
,的名字
,价值
)
集(obj
,cellOfNames
,cellOfValues
)
集(obj
,structOfProperties
)settableProperties
=集(obj
)
集(
将命名属性设置为对象的指定值obj
,的名字
,价值
)obj
。
集(
设置单元格数组中列出的属性obj
,cellOfNames
,cellOfValues
)cellOfNames
到单元格数组中的对应值cellOfValues
。每个单元格数组必须包含相同数量的元素。
集(
设置结构数组的每个字段标识的属性obj
,structOfProperties
)structOfProperties
关联字段的值。
返回可在结构数组中设置的属性的名称。的字段名称settableProperties
=集(obj
)settableProperties
是属性名称。
查看可以为控件设置的属性列表audioplayer
对象:
加载handel.mat;audioplayer(y, Fs);集(handelObj)
设置标签
和用户数据
属性的audioplayer
使用结构数组的对象:
newValues。标签= 'My Tag'; newValues.UserData = {'My User Data', pi, [1 2 3 4]}; load handel.mat; handelObj = audioplayer(y, Fs); set(handelObj, newValues) % View the values all properties. get(handelObj)
的集
函数允许在同一个函数调用中组合属性名称/值对、单元格数组对和结构数组。
要设置单个属性的值,可以使用点表示法。引用每个属性,就像它是结构数组的字段一样。例如,设置标签
对象的属性handelObj
(如示例所示):
handelObj。标签= 'This is my tag.';
这个命令完全等同于:
set(handelObj, 'Tag', 'This is my Tag .');