我正在尝试从matlabl中获取标记数据和edf文件。我使用了edf read,如下所示。
[hdr,label] = edfread('Subject1.edf');
当我在命令窗口输入hdr时,我得到以下内容
ver: 0
patientID: '1 '
recordID: '1 '
startdate: '11.07.16'
starttime: '07.52.30'
bytes: 9472
records: 948
duration: 1
ns: 36
label: {1x36 cell}
transducer: {1x36 cell}
units: {1x36 cell}
physicalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
physicalMax: [1x36 double]
digitalMin: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
digitalMax: [1x36 double]
prefilter: {1x36 cell}
samples: [1x36 double]
然后标记在标签中,所以我输入
hdr.label
给我下面的
>> hdr.label
ans =
Columns 1 through 13
'COUNTER' 'INTERPOLATED' 'AF3' 'F7' 'F3' 'FC5' 'T7' 'P7' 'O1' 'O2' 'P8' 'T8' 'FC6'
Columns 14 through 24
'F4' 'F8' 'AF4' 'RAW_CQ' 'CQ_AF3' 'CQ_F7' 'CQ_F3' 'CQ_FC5' 'CQ_T7' 'CQ_P7' 'CQ_O1'
Columns 25 through 34
'CQ_O2' 'CQ_P8' 'CQ_T8' 'CQ_FC6' 'CQ_F4' 'CQ_F8' 'CQ_AF4' 'CQ_CMS' 'CQ_DRL' 'GYROX'
Columns 35 through 36
'GYROY' 'MARKER'
所以我的问题是,如何获取标记数据?我输入了
>> hdr.label.marker
但我收到错误
Attempt to reference field of non-structure array.
答案 0 :(得分:1)
标签字段不是结构,然后您无法使用点表示法访问。您应该使用" cell array"索引:
hdr.label{end} % last element
以上内容会返回'MARKER'
字符串。