<div dir="ltr"><div><div><div><div><div><div><div><div><div>Ciao Brittany,<br></div>If you want to know the length in seconds of your data, that is easy to calculate.<br></div>The structure in MATLAB that contains the data is EEG.data . It has dimensions electrode x time x trial (or just electrode x time for continuous data). The dimension time is as long as the total amount of samples, so if you want to know the total length of your data in seconds, that would be:<br><br></div>length_in_secs = size( EEG.data , 2 ) / EEG.srate;<br><br></div>This is just dividing the length of your data in samples by your sampling rate.<br><br></div>The function pop_select also accepts samples instead of time, so you could just do:<br><br>EEG = pop_select(EEG, 'point', [size( EEG.data , 2 ) - EEG.srate*600 , size( EEG.data , 2 )] );<br><br></div>That will keep only the last 600 secs, regardless of the actual length of the data.<br><br></div>I hope you find this useful.<br></div>Best,<br></div>Yamil<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 11:22 PM, Brittany Alperin <span dir="ltr"><<a href="mailto:balperin07@gmail.com" target="_blank">balperin07@gmail.com</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><div>Hello<br><br></div>I want to cut all of my datasets down to just include the last 600 seconds and I also want to write some code to automate this.<br><br>Is there a way I can find out the length without manually plotting the data to find out how long the file is? I assume I'll use the select data function (pop_select), but all I know how to do is put in actual numerical values. Using this method I would have to plot each dataset, find out the length, and subtract 600 seconds from that, which is a bit tedious and wouldn't allow me to automate it.<br><br></div><div>Basically, is there a Matlab function that will tell me how many seconds long the file is? Can you enter something other than numbers in the pop_select window?\<br><br></div><div>Thanks,<br></div><div>Brittany<br></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">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">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br></div>