<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Roman,<div><br></div><div>I don't have a lot of experience dealing with brainvision files in fieldtrip, but it looks as though there's something going wrong with the allocation of the data matrix. Apparently, one of the input arguments into the function zeros(), is either not a number, or infinite. This means, that either the quantity endsample-begsmaple+1 is behaving strangely, or that the hdr.NumberOfChannels is faulty, which would point to a problem reading in the header information from your datafile.</div><div><br></div><div>Best,</div><div><br></div><div>jan-Mathijs</div><div><br></div><div><br></div><div><div><div>On 17 Aug 2009, at 14:31, Roman Freunberger 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 lang="DE-AT" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Hello,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I am a new fieldtrip user and would like to know how to read brainvision files that were exported as .dat into matlab with fieldtrip. It would be great to read segmented and/ or continous data into matlab that was preprocessed (artifact correction, …) in brainvision analyzer. I tried read_data in combination with the read_header function and I always get this message:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">??? Error using ==> zeros<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">NaN and Inf not allowed.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Error in ==> read_brainvision_eeg at 89<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">  dat = zeros(endsample-begsample+1, hdr.NumberOfChannels);<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Error in ==> read_data at 686<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">    dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample);<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Error in ==> ReadAnalyzerSegments at 7<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">data = read_data(filename);<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Thank you in advance and best wishes,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Roman<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); ">**********************************************************</span><span lang="EN-US" style="color: rgb(89, 89, 89); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span lang="EN-US" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); ">Dr. Roman Freunberger</span></b><b><span lang="EN-US" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); "></span></b><b><span lang="EN-GB" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); "><o:p></o:p></span></b></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-GB" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); ">Department of Psychology</span><span lang="EN-GB" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); "><br>University of Salzburg</span><span lang="EN-US" style="font-size: 8pt; color: rgb(89, 89, 89); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="DE" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); ">Hellbrunnerstrasse 34</span><span lang="DE" style="font-size: 8pt; color: rgb(89, 89, 89); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="DE" style="font-size: 8pt; font-family: Arial, sans-serif; color: rgb(89, 89, 89); ">5020 Salzburg, Austria<br><br><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div><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><a href="http://listserv.surfnet.nl/archives/fieldtrip.html" style="color: blue; text-decoration: underline; ">http://listserv.surfnet.nl/archives/fieldtrip.html</a></p><p><a href="http://www.ru.nl/fcdonders/fieldtrip/" style="color: blue; text-decoration: underline; ">http://www.ru.nl/fcdonders/fieldtrip/</a></p></div></span></blockquote></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>