First, we need to create an `Anninfo' structure (which might seem like a complicated way to go, but it reflects the way the C wfdb library works) containing the name and mode of the annotation file:
>> A = WFDB_Anninfo(1)
A =
name: 'a1'
stat: 'WFDB_READ'
The record 100s has an annotator named 'atr', so we need to change the name field of A before issuing the command to open the file.
>> A.name = 'atr'
A =
name: 'atr'
stat: 'WFDB_READ'
>> WFDB_annopen('100s', A)
Now the annotation file is open and we may read the first two annotations, and take a closer look at the second one.
>> ANNOTATION = WFDB_getann(0, 2)
ANNOTATION =
2x1 struct array with fields:
time
anntyp
subtyp
chan
num
aux
>> ANNOTATION(2)
ans =
time: 77
anntyp: 1
subtyp: 0
chan: 0
num: 0
aux: ''
Next, let's see what the annotation type (the anntyp field) means, in mnemonic and description:
>> WFDB_annstr(ANNOTATION(2).anntyp)
ans =
N
>> WFDB_anndesc(ANNOTATION(2).anntyp)
ans =
Normal beat
Finally,
>> WFDB_wfdbquit