TEAP (Toolbox for Emotion Analysis using Physiological Signals) doc
seof.m
Go to the documentation of this file.
1 function [status]=seof(HDR)
2 % SEOF checks for end of signal-file
3 % status = seof(HDR)
4 %
5 % returns 1 if End-of-EDF-File is reached
6 % returns 0 otherwise
7 %
8 % See also: SOPEN, SREAD, SWRITE, SCLOSE, SSEEK, SREWIND, STELL, SEOF
9 
10 % This program is free software; you can redistribute it and/or
11 % modify it under the terms of the GNU General Public License
12 % as published by the Free Software Foundation; either version 3
13 % of the License, or (at your option) any later version.
14 
15 % $Id: seof.m 2205 2009-10-27 12:18:15Z schloegl $
16 % (C) 1997-2005,2007,2008 by Alois Schloegl <a.schloegl@ieee.org>
17 % This is part of the BIOSIG-toolbox http://biosig.sf.net/
18 
19 
20 %status=feof(HDR.FILE.FID); % does not work properly
21 %if HDR.FILE.POS~=HDR.AS.startrec+HDR.AS.numrec;
22 
23 if strmatch(HDR.TYPE,{'CTF','RDF','EEG','AVG','SIGIF'}),
24  %status=feof(EDF.FILE.FID); % does not work properly
25  %if EDF.FILE.POS~=EDF.AS.startrec+EDF.AS.numrec;
26  status = (HDR.FILE.POS >= HDR.NRec);
27 
28 elseif strmatch(HDR.TYPE,{'RG64','LABVIEW','Nicolet'}),
29  status = (HDR.FILE.POS >= (HDR.AS.endpos-HDR.HeadLen));
30 
31 elseif strmatch(HDR.TYPE,{'ACQ','AINF','BDF','BKR','BrainVision','CNT','CTF','EDF','ET-MEG','GDF','MIT','SMA','CFWB','DEMG','EEProbe-CNT','EEProbe-AVR','MFER','alpha','native','SCP','BCI2000','TMS32','WG1','Sigma'}),
32  status = (HDR.FILE.POS >= HDR.SPR*HDR.NRec);
33 
34 elseif strmatch(HDR.TYPE,{'EGI'}),
35  if HDR.FLAG.TRIGGERED,
36  status = (HDR.FILE.POS >= HDR.NRec);
37  else
38  status = (HDR.FILE.POS >= HDR.SPR);
39  end;
40 
41 elseif strmatch(HDR.TYPE,{'FIF'}),
42  [buf, status] = rawdata('next');
43  status = strcmp(status,'eof');
44 
45 else
46  status=feof(HDR.FILE.FID);
47 end;
seof
function seof(in HDR)