<div dir="ltr"><div>Hi Chris,</div><div>I've been reading your post now and made some very basic testing of  what you describe. Basically, importing and EDF file to eeglab, and then loading again the file after exporting it.. right?</div>
<div> Well.. this example works for me... let me know any thought about it.</div><div> Hope this helps,</div><div> Ramon</div><div><br></div><div> % Start EEGLAB</div><div>[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;</div><div>
<br></div><div>% Replace this fields with your path and filenames</div><div>datapath = '/home/ramon/WORK/EEGLab_bugfix/bug_1523/';</div><div>datafilename = '5038.edf';</div><div>datafile2save = 'test_export.edf';</div>
<div><br></div><div>% Import EDF using BIOSIG</div><div>EEG = pop_biosig([datapath datafilename]);</div><div><br></div><div>% Writing the data</div><div>pop_writeeeg(EEG, [datapath datafile2save], 'TYPE','EDF');</div>
<div><br></div><div> % Now importing again the saved file</div><div>EEG = pop_biosig([datapath datafile2save]);</div><div><br></div><div>% This works for me :)</div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jul 9, 2014 at 9:47 AM, Makoto Miyakoshi <span dir="ltr"><<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks Chris, that's very good to know. I'll let our developer know about it. Sorry for inconvenience and thank you for your help.<span class="HOEnZb"><font color="#888888"><div><br></div><div>Makoto</div>
</font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br>

<div class="gmail_quote">On Wed, Jul 9, 2014 at 7:47 AM, Parker, Christopher <span dir="ltr"><<a href="mailto:christopher.parker.10@ucl.ac.uk" target="_blank">christopher.parker.10@ucl.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear EEGLab users,</p>
<p><br>
</p>
<p>If you want to read/write EEG files to disk, you can use these functions posted on Mathworks.</p>
<p><br>
</p>
<p><a href="http://www.mathworks.co.uk/matlabcentral/fileexchange/36530-read---write-edf+-files/content/lab_write_edf.m" target="_blank">http://www.mathworks.co.uk/matlabcentral/fileexchange/36530-read---write-edf+-files/content/lab_write_edf.m</a><br>



</p>
<p><br>
</p>
<p>The EEGLab writing functions don't work for me.<br>
</p>
<p><br>
</p>
<p>Chris<br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Makoto Miyakoshi <<a href="mailto:mmiyakoshi@ucsd.edu" target="_blank">mmiyakoshi@ucsd.edu</a>><br>
<b>Sent:</b> 08 July 2014 17:47<br>
<b>To:</b> Parker, Christopher; Ramón Martinez<br>
<b>Cc:</b> <a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a><br>
<b>Subject:</b> Re: [Eeglablist] save .edf file</font>
<div> </div>
</div><div><div>
<div>
<div dir="ltr">Dear Ramon,
<div><br>
</div>
<div>Here is a file I/O issue.</div>
<div><br>
</div>
<div>Makoto</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Jul 2, 2014 at 4:05 PM, Parker, Christopher <span dir="ltr">
<<a href="mailto:christopher.parker.10@ucl.ac.uk" target="_blank">christopher.parker.10@ucl.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi,</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<p>I read my .edf file in to MATLAB using:</p>
<p><br>
</p>
<p>a = pop_biosig(a_filename, 'importevent','off','importannot','off');</p>
<p><br>
</p>
<p>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.
<br>
</p>
<p><br>
</p>
<p>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:</p>



<p><br>
</p>
<p>Reading data in unknown format...<br>
Reference to non-existent field 'POS'.<br>
<br>
Error in sread (line 53)<br>
        StartPos = HDR.FILE.POS/HDR.SampleRate;<br>
<br>
Error in pop_biosig>readfile (line 224)<br>
        DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!<br>
<br>
Error in pop_biosig (line 142)<br>
[dat DAT interval] = readfile(filename, g.channels, g.blockrange, g.memorymapped);</p>
<p><br>
</p>
<p>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:</p>
<p><br>
</p>
<p>Reference to non-existent field 'POS'.<br>
<br>
Error in sread (line 53)<br>
        StartPos = HDR.FILE.POS/HDR.SampleRate;<br>
<br>
Error in pop_biosig>readfile (line 224)<br>
        DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!!<br>
<br>
Error in pop_biosig (line 142)<br>
[dat DAT interval] = readfile(filename, g.channels, g.blockrange, g.memorymapped);</p>
<p><br>
</p>
<p>The saved files also do not open in EDF Browser. Your help with this would be very much appreciated.</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Chris<br>
</p>
</div>
</div>
<br>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">
http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">
eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">
eeglablist-request@sccn.ucsd.edu</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">Makoto Miyakoshi<br>
Swartz Center for Computational Neuroscience<br>
Institute for Neural Computation, University of California San Diego<br>
</div>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div>



</div>
</div></div></blockquote></div><br></div>