a = struct('a1',{1,2,3},'a2',{4,5,6})
如何获取值1的数值?
我尝试使用a.a1{1},但是出现错误。
>> a.a1{1}
??? Field reference for multiple structure elements that is followed by more reference blocks is an
error.
如何访问数字1?谢谢。
编辑
A = struct{'a1',[1 2 3],'a2',[4 5 6]}
我该如何访问数字1呢?我使用A(1).a1
,但是我得到的是1 2 3