1 function [status]=
seof(HDR)
2 % SEOF checks
for end of signal-file
5 % returns 1
if End-of-EDF-File is reached
8 % See also: SOPEN, SREAD, SWRITE, SCLOSE, SSEEK, SREWIND, STELL, SEOF
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.
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:
20 %status=feof(HDR.FILE.FID); % does not work properly
21 %
if HDR.FILE.POS~=HDR.AS.startrec+HDR.AS.numrec;
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);
28 elseif strmatch(HDR.TYPE,{
'RG64',
'LABVIEW',
'Nicolet'}),
29 status = (HDR.FILE.POS >= (HDR.AS.endpos-HDR.HeadLen));
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);
34 elseif strmatch(HDR.TYPE,{
'EGI'}),
35 if HDR.FLAG.TRIGGERED,
36 status = (HDR.FILE.POS >= HDR.NRec);
38 status = (HDR.FILE.POS >= HDR.SPR);
41 elseif strmatch(HDR.TYPE,{
'FIF'}),
42 [buf, status] = rawdata(
'next');
43 status = strcmp(status,
'eof');
46 status=feof(HDR.FILE.FID);