[Eeglablist] save .edf file

Alois Schloegl alois.schloegl at ist.ac.at
Thu Jul 10 02:01:15 PDT 2014


Try applying the following patch. It should be a workaround for your
issue.

Cheers,
  Alois




diff --git a/biosig4matlab/t200_FileAccess/sread.m
b/biosig4matlab/t200_FileAccess/sread.m
index 14888ff..51d2990 100644
--- a/biosig4matlab/t200_FileAccess/sread.m
+++ b/biosig4matlab/t200_FileAccess/sread.m
@@ -50,6 +50,9 @@ if (nargin>=3)
                 StartPos = round(tmp)/HDR.SampleRate;
         end;
 else
+       if ~isfield(HDR.FILE,'POS')
+               HDR.FILE.POS = 0;
+       end;
         StartPos = HDR.FILE.POS/HDR.SampleRate;
 end;




On 2014-07-03 01:05, Parker, Christopher wrote:
> Hi,
> 
> 
> Does anyone know how to save an eeglab structure as a .edf file in MATLAB? pop_export() doesn't seem to be working for me.
> 
> 
> I read my .edf file in to MATLAB using:
> 
> 
> a = pop_biosig(a_filename, 'importevent','off','importannot','off');
> 
> 
> I now want to make some change to the 'data' field (append data from another eeg structure) and then save the .edf file with a different filename.
> 
> 
> I tried "pop_export(a,'~/test.edf')" which did save a.edf file in the appropriate place. But it then failed to read back in to MATLAB properly with pop_biosig(). The following error was displayed:
> 
> 
> Reading data in unknown format...
> Reference to non-existent field 'POS'.
> 
> Error in sread (line 53)
>         StartPos = HDR.FILE.POS/HDR.SampleRate;
> 
> Error in pop_biosig>readfile (line 224)
>         DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!
> 
> Error in pop_biosig (line 142)
> [dat DAT interval] = readfile(filename, g.channels, g.blockrange, g.memorymapped);
> 
> 
> I also tried it with an empty structure created by typing "eeglab" in to the command line. Again, the file saved but could not be read back in to MATLAB. This gave the error:
> 
> 
> Reference to non-existent field 'POS'.
> 
> Error in sread (line 53)
>         StartPos = HDR.FILE.POS/HDR.SampleRate;
> 
> Error in pop_biosig>readfile (line 224)
>         DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!
> 
> Error in pop_biosig (line 142)
> [dat DAT interval] = readfile(filename, g.channels, g.blockrange, g.memorymapped);
> 
> 
> The saved files also do not open in EDF Browser. Your help with this would be very much appreciated.
> 
> 
> Thanks,
> 
> Chris
> 
> 
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
> 




More information about the eeglablist mailing list