<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear W.Saad,<div><br></div><div>Could it be that there is a typo in how you define data.time? You define it in sample numbers but it should be in seconds: data.time{1} = [1:filelength]./daga.fsample;</div><div><br></div><div>I guess this may help.</div><div><br></div><div>Best,</div><div><br></div><div>Jan-Mathijs</div><div><br><div><div>On May 26, 2010, at 12:09 PM, W. Saad wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Hi,<br><br>I am new to matlab and FieldTrip - so bare with me and thanks for your feedback in advance :)<br><br>I have a csv file containing readings for 25 electrode EEG trial. There are 129,908 readings in<br>the file (sampling rate is 256 - approx. 507 seconds) The file is 25 columns by 129,908 rows.<br><br>I would like to calculate power for each of the 5 wave types for each channel. Also, I would<br>like to find the coherence for all intra-hemispheric and inter-hemispheric pairwise<br>combination of the 25 channels (300 in total).<br><br>I am trying the following code but getting a memory error and other errors (code is mostly based<br>on the samples I have found in FieldTrip website).<br><br><br>%--------------------------------------------------------------<br><br>fieldtripdefs;<br> <br>filename='recall.dat';<br>filelength=129908;<br>rdata=csvread(filename);<br>rdata=rdata';<br><br>% cell-array containing strings, Nchan X 1<br>data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'};<br><br>% sampling frequency in Hz, single number<br>data.fsample = 256;<br><br>% cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples<span class="Apple-converted-space"> </span><br>data.trial = {rdata};<br><br>% cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector<span class="Apple-converted-space"> </span><br>timevector = [1:filelength];<br>data.time = { timevector };<br><br>cfg            = [];<br>cfg.output     = 'powandcsd';<br>cfg.method     = 'mtmfft';<br>cfg.foilim     = [0.5 50];<br>cfg.tapsmofrq  = 5;<br>cfg.keeptrials = 'yes';<br>cfg.channel    = {'all' };<br>cfg.channelcmb = {'all' 'all'};<br>freq           = ft_freqanalysis(cfg, data);<br><br>cfg            = [];<br>cfg.method     = 'coh';<br>cfg.channelcmb = {'all' 'all'};<br>fd             = ft_connectivityanalysis(cfg, freq);<br><br>% Let us not draw for now..<br>%cfg                  = [];<br>%cfg.xparam           = 'freq';<br>%cfg.zparam           = 'cohspctrm';<br>%cfg.xlim             = [5 80];<br>%cfg.cohrefchannel    = 'EMGlft';<br>%cfg.layout           = 'CTF151.lay';<br>%cfg.showlabels       = 'yes';<br>%figure; ft_multiplotER(cfg, fd)<br><br>-----------------------------------------------------------------<br><br>The messages/error I get is:<br><br>the input is raw data with 25 channels and 1 trials<br>??? Maximum variable size allowed by the program is exceeded.<br><br>Error in ==> dpss>dpsscalc at 127<br>E = zeros(N,k(2)-k(1)+1);<br><br>Error in ==> dpss at 54<br>   [E,V] = dpsscalc(N,NW,k);<br><br>Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423<br>tap = dpss(double(a), double(b), varargin{:});<br><br>Error in ==> ft_freqanalysis_mtmfft at 249<br>    tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))';<br><br>Error in ==> ft_freqanalysis at 75<br>  [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data);<br><br>Error in ==> saad_fieldtrip at 29<br>freq           = ft_freqanalysis(cfg, data);<br><br>-----------------------------------------------------------------<br><br>I have been looking around in the discussion board trying to find how to read a csv file with no success (though it looks to me it<span class="Apple-converted-space"> </span><br>was read successfully since Fieldtrip detected it has 25 channels).<br><br>Also, I am worried about the message<span class="Apple-converted-space"> </span><br>??? Maximum variable size allowed by the program is exceeded.<br>Because most of my trials are huge in size, in fact the biggest file size I have is 25 columns x 250,000 rows (~60MB).<br><br>Your input is highly appreciated.<br><br>Thanks.<span class="Apple-converted-space"> </span><br><hr>30 days of prizes: Hotmail makes your day easier!<span class="Apple-converted-space"> </span><a href="http://go.microsoft.com/?linkid=9729704" target="_new">Enter now</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">----------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://listserv.surfnet.nl/archives/fieldtrip.html">http://listserv.surfnet.nl/archives/fieldtrip.html</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.ru.nl/fcdonders/fieldtrip/">http://www.ru.nl/fcdonders/fieldtrip/</a></div></div></span></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dr. J.M. (Jan-Mathijs) Schoffelen </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: 0031-24-3668063</div></div></span> </div><br></div></body></html><p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>