Matlab: Listing field name values of a struct
s = struct ;
s(1).dat =‘a' ;
s(1).freq=11 ;
s(2).dat =‘b' ;
s(2).freq=22 ;
Where:
s(1)
ans =
dat: 'a'
freq: 11
How do you access [‘a’, ‘b’] and [11, 22]?
[s.dat] , [s.freq]
The []
are really important here.
[s.freq]
ans =
11 22
Programming
Matlab
]