-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselan.m
34 lines (29 loc) · 840 Bytes
/
selan.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% Extraction type anntyp and number num annotations from anot annotator
% function [anot]=selan(anot,type,number,l,t)
%
% Jose Garcia Moros
% email: [email protected]
% last revision: 20 Oct 1997
function [anot]=selan(anot,type,number,l,t)
if type=='t', auxi=find(~(anot(l).anntyp==type));
else auxi=find(~(anot(l).anntyp==type & anot(l).num==number));
end
if (~isempty(auxi))
anot(l).anntyp(auxi)=[];
anot(l).time(auxi)=[];
anot(l).num(auxi)=[];
anot(l).subtyp(auxi)=[];
anot(l).chan(auxi)=[];
%anot(l).aux(auxi,:)=[];
end
if nargin==5
auxi=find(anot(l).time<t(1) | anot(l).time>t(2));
if (~isempty(auxi))
anot(l).anntyp(auxi)=[];
anot(l).time(auxi)=[];
anot(l).num(auxi)=[];
anot(l).subtyp(auxi)=[];
anot(l).chan(auxi)=[];
%anot(l).aux(auxi,:)=[];
end
end