<div dir="auto">Thanks Makoto. I solved the problem, the script works correctly.</div><div class="gmail_extra"><br><div class="gmail_quote">Il 24/gen/2017 9:14 PM, "Makoto Miyakoshi" <<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Gian,<div><br></div><div>I have never been an ERPLAB user, so I could be wrong.</div><div>There are two possibilities.</div><div>1. length(files) == 2 by mistake</div><div>2. There are only two file names available to save data</div><div>Check which one is the case by using Matlab debug mode.</div><div><br></div><div>Makoto</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 18, 2017 at 1:36 AM, Gian Marco Duma <span dir="ltr"><<a href="mailto:gmduma90@gmail.com" target="_blank">gmduma90@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear EEGLAB users,<div>I'm doing a little script but I'm finding some problems. </div><div>My aim is to create a cycle to export in .txt the erpvalues of 2 bin of an erpset, obtained with ERPLAB, So, I created a cycle. first of all teh cycle load erpset. This command line works correctly. Than the cycle should export the erpvalues of 2 bin, so I use the popfunction </div><div><div><br></div><div>pop_export2text(ERP, filename, binArray, time, timeunit, electrodes, transpose, precision)<br></div><div><br></div><div>This function create a .txt file for each selected bin. I want to name the .txt file with the name of the erpset. For example, if my erp set is named <b>sj1 </b>and my bins are 17 18, I should have 2 files: sj15_17, and sj15_18, and so on for the rest of my subjects.</div><div><br></div><div><div>This is the directory where the function should export the 2 .txt files</div><div>'C:\Users\Utente\Desktop\TO-VS<wbr>TM\prova'<br></div></div><div><br></div><div>There are no problem to name in this way from the GUI. But I should do it manually, and it is time consuming. if I write the commandline:</div><div><br></div><div> pop_export2text( ERP,'C:\Users\Utente\Desktop\T<wbr>O-VSTM\txtfiles\sj1)', [ 17 18], 'precision',2, 'timeunit',0.001 )<br></div><div>it works correctly.<br></div></div><div><br></div><div><br></div><div>This is my cycle:</div><div><div><div>cd 'C:\Users\Utente\Desktop\TO-VS<wbr>TM\CHILDREN\ERP\ERP_array';</div><div>path= 'C:\Users\Utente\Desktop\TO-VS<wbr>TM\CHILDREN\ERP\ERP_array';</div><div>file= dir('*.erp');</div><div>files={file(:).name}'</div></div><div><br></div><div><div>for ss=1:length(files)</div><div> fname=char(files(ss));</div><div> </div><div> [ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );</div><div> </div><div> ERP = pop_loaderp( 'filename', fname, 'filepath', path);</div><div> </div><div> pop_export2text( ERP,'C:\Users\Utente\Desktop\T<wbr>O-VSTM\txtfiles\,filename.xtx ', [ 17 18], 'precision',2, 'timeunit',0.001 );</div><div>end</div></div><div><br></div><div>everything works correctly except that it creates just each run 2 file named: fname_17, fname_18, and of course each cycle they overwrite, I have 20 subjects, and at the end I should obtain 40 .txt file but in the txtfiles folder I have just 2 file. </div></div><div>what should I write in the pop_export2text function at the level of filename, so that the cycle name each file with the name of the erpset, exporting the file in the directory I chose?</div><div><br></div><div><div>pop_export2text( ERP,'C:\Users\Utente\Desktop\T<wbr>O-VSTM\txtfiles\???', [ 17 18], 'precision',2, 'timeunit',0.001 );</div><div><br></div></div><div>I'm sorry, I know that the e-mail is long.</div><div>Thanks for your help</div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/ee<wbr>glabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.uc<wbr>sd.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.e<wbr>du</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-6236957733209919007gmail_signature"><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></div>