<DIV>Hi Robert,</DIV>  <DIV>Thank you very much for your help, I was wondering whether I could trouble you with a couple more questions. I converted my besa data to fieldtrip format and this seemed to work fine. I got no error messages and the data structures look like they contain all my data in them (I am attaching an example mat file with the output structures from a few subjects). However, I am still having problems with running freqstatistics. The cfg options are defined OK but the matlab script crushes when it comes to calling statistics_wrapper. The error message I get is as follows:</DIV>  <DIV>"Could not determine type of input data" which leads me to believe there is a problem with the converted data.</DIV>  <DIV><BR>I am also attaching my script for freqstatistics in case you need to see this file.</DIV>  <DIV>Very many thanks for your help,</DIV>  <DIV>Lorina</DIV>  <DIV> </DIV>  <DIV><BR><B><I>Robert Oostenveld <r.oostenveld@FCDONDERS.RU.NL></I></B>
 wrote:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi Lorina<BR><BR>On 8 Nov 2006, at 20:00, Lorina Naci wrote:<BR>> I tried to run the script as you suggested but it did not work. The <BR>> error message I get is to do with<BR>> [stat] = statistics_wrapper(cfg, varargin{:}). It just gives me an <BR>> error message pointing to this line,saying: error using <BR>> fieldtrip-20061003/private/statistics_wrapper, could not determine <BR>> the type of input data.<BR><BR>Then it means that the data structure that you have obtained from <BR>besa2fieldtrip is not recognized. It is also not clear to me how your <BR>data looks like (i.e. as a Matlab structure). It is virtual channel <BR>data, time-frequency analyzed, and then single trial coherences <BR>computed?<BR><BR>Could you show the output that you get on screen after<BR><BR>dataA = besa2fieldtrip('filenameA.tfc') % i.e. without semicolon, <BR>to
 show the output on screen<BR>dataB = besa2fieldtrip('filenameB.tfc') % i.e. without semicolon, <BR>to show the output on screen<BR><BR>> Also, the function 'cfg.numrandomization' requires a number, but I <BR>> am not sure what the choice of the number depends on? I've inputed <BR>> 500 as in the documentation example.<BR><BR>That is the number of resamplings that is used to construct the <BR>reference distribution, 500 should be fine.<BR><BR>> Finally, at risk making my ignorance of how Fieldtrip works <BR>> entirely transparent, I am not quite sure how the function you send <BR>> me 'statfun_diff.m' links with the 'freqstatistics.m,' and whether <BR>> I do need to use it?<BR><BR>You just have to put it on your Matlab path somewhere, and you specify<BR>cfg.statistic ='diff'<BR>in freqstatistics. In general by specifying cfg.statistic='xxx', the <BR>function statfun_xxx will be called. Please look in the function <BR>statfun_diff.m to see how the
 statistic for each sample (=time- <BR>frequency-channel point) is computed.<BR><BR>best regards,<BR>Robert<BR></BLOCKQUOTE><BR><p> Send instant messages to your online friends http://uk.messenger.yahoo.com