<DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">Dear Jan-Mathijs, thanks so much for your message. I am sorry I did not respond any earlier – the message ended up misclassified in my mailbox and I did not notice it.</SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN> </DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">Thank you for sending me the modified script. I’ve defined the cfg.neighbours</SPAN><?xml:namespace prefix = st1 ns = "isiresearchsoft-com/cwyw" /><st1:citation><SPAN style="FONT-SIZE: 10pt">{j}</SPAN></st1:citation><SPAN
 style="FONT-SIZE: 10pt">.label by entering one of my data structures. Also, I’ve loaded all my subjects’ data structures which are saved in the file ‘allsubjects.m’</SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">I ran it but again it crashes, giving the same error pointing to the statistics_wrapper, saying that the input data could not be determined. I am attaching here my scrip and ‘allsubjects.m’<o:p></o:p></SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">Sorry to keep bothering you with this. </SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0cm
 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">Many thanks for your help,<o:p></o:p></SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN style="FONT-SIZE: 10pt">Lorina<o:p></o:p></SPAN></DIV><BR><BR><B><I>Jan Mathijs Schoffelen <Jan.Schoffelen@FCDONDERS.RU.NL></I></B> wrote:   <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <META content="Microsoft Word 11 (filtered medium)" name=Generator>  <STYLE>  v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}  </STYLE>  <o:SmartTagType
 name="PersonName" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType>  <STYLE>  st1\:*{behavior:url(#default#ieooui) }  </STYLE>    <STYLE>  <!--   /* Font Definitions */   @font-face   {font-family:Tahoma;   panose-1:2 11 6 4 3 5 4 4 2 4;}   /* Style Definitions */   p.MsoNormal, li.MsoNormal, div.MsoNormal   {margin:0in;   margin-bottom:.0001pt;   font-size:12.0pt;   font-family:"Times New Roman";}  h1   {margin-top:12.0pt;   margin-right:0in;   margin-bottom:3.0pt;   margin-left:0in;   page-break-after:avoid;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;}  h2   {margin-top:12.0pt;   margin-right:0in;   margin-bottom:3.0pt;   margin-left:0in;   page-break-after:avoid;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;   font-style:italic;}  h3   {margin-top:12.0pt;   margin-right:0in;   margin-bottom:3.0pt;   margin-left:0in;   line-height:200%;   page-break-after:avoid;   font-size:12.0pt;
 font-family:"Times New Roman";   font-weight:bold;}  p.MsoToc5, li.MsoToc5, div.MsoToc5   {margin:0in;   margin-bottom:.0001pt;   font-size:11.0pt;   font-family:"Times New Roman";   font-style:italic;}  p.MsoBodyText, li.MsoBodyText, div.MsoBodyText   {margin-top:0in;   margin-right:0in;   margin-bottom:6.0pt;   margin-left:0in;   font-size:12.0pt;   font-family:"Times New Roman";}  a:link, span.MsoHyperlink   {color:blue;   text-decoration:underline;}  a:visited, span.MsoHyperlinkFollowed   {color:purple;   text-decoration:underline;}  p   {mso-margin-top-alt:auto;   margin-right:0in;   mso-margin-bottom-alt:auto;   margin-left:0in;   font-size:12.0pt;   font-family:"Times New Roman";}  p.JMsstyle01, li.JMsstyle01, div.JMsstyle01   {margin:0in;   margin-bottom:.0001pt;   line-height:200%;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;}  p.JMsstyle02, li.JMsstyle02, div.JMsstyle02   {margin:0in;   margin-bottom:.0001pt;   line-height:200%;
 font-size:12.0pt;   font-family:"Times New Roman";   font-style:italic;}  p.JMsstyle03, li.JMsstyle03, div.JMsstyle03   {margin:0in;   margin-bottom:.0001pt;   text-align:justify;   line-height:200%;   font-size:12.0pt;   font-family:"Times New Roman";   font-weight:bold;   font-style:italic;}  span.EmailStyle23   {mso-style-type:personal-reply;   font-family:Arial;   color:navy;}  @page Section1   {size:8.5in 11.0in;   margin:1.0in 1.25in 1.0in 1.25in;}  div.Section1   {page:Section1;}  -->  </STYLE>    <DIV class=Section1>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Dear Lorina,<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Even though my
 name is not Robert, I hope that is OK. I do not really understand why you use freqstatistics_test function the way you do, but this is the way I get it going in your case (so not using the function you sent along: and I think what went wrong is how you configured your input-data):<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.method = ‘montecarlo’;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.statistic = ‘diff’;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.parameter = ‘powerspctrm’; %these
 contain coherences in reality, right?<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.numrandomization = something;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.design = dependent on your input data;<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.ivar = 1; %put condition in the first row of your desing-matrix<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Cfg.uvar = 2; %put the subject-index on the second row<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY:
 Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">And now comes the trick, and I guess that’s why you tried it the way you did, at least so that you would not run into problems with neighbourselection anymore.<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">For j = 1:length(dataBlabla.label)<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">  Cfg.neighbours{j}.label = dataBlabla.label{j};<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE:
 10pt; COLOR: navy; FONT-FAMILY: Arial">  Cfg.neighbours{j}.neighblabel = {};<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">End<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You have virtual channel data, so the neighbourhood-structure is irrelevant for clustering (you don’t want to cluster in space, but only in time and frequency perhaps)<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE:
 10pt; COLOR: navy; FONT-FAMILY: Arial">At least it should run through if you call:<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Stat = freqstatistics(cfg, dataS1C1, dataS1C2, dataS2C1 etc)<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Yours,<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT
 face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jan-Mathijs<o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></DIV>  <DIV class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV>  <DIV>  <DIV class=MsoNormal style="TEXT-ALIGN: center"
 align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">  <HR tabIndex=-1 align=center width="100%" SIZE=2>  </SPAN></FONT></DIV>  <DIV class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName w:st="on">FieldTrip discussion list</st1:PersonName> [mailto:FIELDTRIP@NIC.SURFNET.NL] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Lorina Naci<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, November 10, 2006 6:41 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> FIELDTRIP@NIC.SURFNET.NL<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [FIELDTRIP] Within-subject coherence statististics for virtual sources</SPAN></FONT><o:p></o:p></DIV></DIV>  <DIV
 class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Hi Robert,<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">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:<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV
 class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">"Could not determine type of input data" which leads me to believe there is a problem with the converted data.<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><BR>I am also attaching my script for freqstatistics in case you need to see this file.<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Very many thanks for your help,<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Lorina<o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></DIV></DIV>  <DIV>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE:
 12pt"><BR><st1:PersonName w:st="on"><B><I><SPAN style="FONT-WEIGHT: bold; FONT-STYLE: italic">Robert Oostenveld</SPAN></I></B></st1:PersonName><B><I><SPAN style="FONT-WEIGHT: bold; FONT-STYLE: italic"> <r.oostenveld@FCDONDERS.RU.NL></SPAN></I></B> wrote:<o:p></o:p></SPAN></FONT></DIV></DIV>  <BLOCKQUOTE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; MARGIN-TOP: 5pt; PADDING-LEFT: 4pt; MARGIN-BOTTOM: 5pt; PADDING-BOTTOM: 0in; MARGIN-LEFT: 3.75pt; BORDER-LEFT: #1010ff 1.5pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: medium none">  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">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<o:p></o:p></SPAN></FONT></DIV></BLOCKQUOTE>  <DIV class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></DIV>  <DIV><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> Send instant messages to your online friends http://uk.messenger.yahoo.com
 <o:p></o:p></SPAN></FONT></DIV></DIV></BLOCKQUOTE><BR><p>
                <hr size=1>
<a href="http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/spam_1gb/*http://us.rd.yahoo.com/evt=40565/*http://uk.docs.yahoo.com/nowyoucan.html">Inbox full of spam?</a> Get leading spam protection and 1GB storage with All New Yahoo! Mail.