<div style="font-family: 'Times New Roman'; font-size: 16px;">Dear Claudia, <br _moz_dirty="" /><br _moz_dirty="" />the first error message seems a 'matlab-related error', it does not have anything to do with fieldtrip, but just with the way you use matlab. Basically matlab is complaining because the function you are using is not defined to use cell types. I believe that data.time is probably containing something like<br _moz_dirty="" /><br _moz_dirty="" />data.time = {1,2,3};<br _moz_dirty="" /><br _moz_dirty="" />then, what you should do, is to use the function like this:<br _moz_dirty="" /><br _moz_dirty="" />isnan(data.time{:}) % this will show the content of data.time "ignoring" that it is a cell<br _moz_dirty="" />rather than <br _moz_dirty="" />isnan(data.time) % this will feed a cell to the isnan function, which uses arrays of numbers<br _moz_dirty="" /><br _moz_dirty="" />About the warning message you get I cannot help you with that one, I'm sorry. <br _moz_dirty="" /><br _moz_dirty="" />The best of luck!<br _moz_dirty="" /><br _moz_dirty="" />Paolo <br /><br /><span>On 16/09/09, <b class="name">"Bonin, Claudia (NIH/NINDS) [F]" </b> <boninc@NINDS.NIH.GOV> wrote:</span><blockquote cite="mid:42BB71E278C5804494BA79D3B24B0A7F161DA99B@NIHMLBX10.nih.gov" class="iwcQuote" style="border-left: 1px solid rgb(0, 0, 255); padding-left: 13px; margin-left: 0pt;" type="cite"><div class="mimepart text plain">Hi. I am having trouble getting a freqstastics script to run to do a Kruskalwallis test. Thre freqgrandaverage works but I am having trouble with the arguments for the Kruskalwallis. I have pasted in the script and the error message in this email.  Has anyone written a script using freqsstatistics to do Kruskalwallis? I would love to see it or get some direction on the arguments that need to be assigned....Also I made up an argument for cfg.design but I don't really understand what this assignment is. Could anyone elaborate?<br />Thank you!<br />claudia Bonin<br /><br /><br /><br /><br /><br />here's the error message <br /><br /> isnan(data.time)<br />??? Undefined function or method 'isnan' for input arguments of type 'cell'.<br /> <br />computing average power over 21 subjects<br />Warning: discarding gradiometer information <br />> In freqgrandaverage at 121<br />  In tf2_virt_all_plot at 11<br /><br />here's the script.....<br /><br /><br />Nsubj = 21;<br /><br />for subj = 1:Nsubj<br />    fname = ['/home/boninc/tfresults/subj' 64 + subj];<br />    clear fr<br />    load(fname);<br />    frs(subj) = fr;<br />end<br /><br />cfg = [];<br />[gr] = freqgrandaverage(cfg, frs(1), frs(2), frs(3), frs(4), frs(5), frs(6), frs(7), frs(8), frs(9), frs(10), frs(11), frs(12), frs(13), frs(14), frs(15), frs(16), frs(17), frs(18), frs(19), frs(20), frs(21));<br /><br />%cfg = [];<br />%cfg.alpha = .05;<br />%cfg.method = 'stats';<br />%cfg.design = 1:21;<br />%cfg.statistic = 'kruskalwallis';<br />%[stat] = freqstatistics(cfg, frs(1), frs(2), frs(3), frs(4), frs(5), frs(6), frs(7), frs(8), frs(9), frs(10), frs(11), frs(12), frs(13), frs(14), frs(15), frs(16), frs(17), frs(18), frs(19), frs(20), frs(21));<br /><br />clf<br />contourf(gr.time, gr.freq, squeeze(sum(gr.powspctrm))); colorbar<br />%contourf(gr.time, gr.freq, gr.powspctrm); colorbar<br /><br />title '21 Subjects, RandL, RIGHT Central Motor'<br />xlabel 'time, sec'<br />ylabel 'frequency, Hz'<br /><br /><br />________________________________________<br />From: FieldTrip discussion list [FIELDTRIP@NIC.SURFNET.NL] On Behalf Of Hanneke Van Dijk [Hanneke.vanDijk@MED.UNI-DUESSELDORF.DE]<br />Sent: Thursday, September 10, 2009 7:21 AM<br />To: FIELDTRIP@NIC.SURFNET.NL<br />Subject: [FIELDTRIP] AW: [FIELDTRIP] freqstastics script<br /><br />Dear Claudia,<br /><br />Normally when matlab says 'undefined function for input of type ....' it means it cannot find the specific function in the paths you have defined. You can check whether neighbourselection.m is in your fieldtrip folder, if not I have attached it (version 20090428) so you can put it there. If this doesn't fix it please let me know!<br /><br />Groetjes Hanneke<br /><br /><br />-----Ursprüngliche Nachricht-----<br />Von: FieldTrip discussion list im Auftrag von Bonin, Claudia (NIH/NINDS) [F]<br />Gesendet: Mi 09.09.2009 18:26<br />An: FIELDTRIP@NIC.SURFNET.NL<br />Betreff: [FIELDTRIP] freqstastics script<br /><br />I am trying to do statistics on time-frequency data across 16 subjects, averaging over channels. I received back the following error about 'neighbourselection' which means nothing to me.....Does anyone have any idea what might be wrong here? I have pasted in the exact message below.<br />thanks!<br />claudia<br /><br /><br />>> cfg.statistic = 'kruskalwallis';<br />>> cfg.method = 'stats';<br />>> [s] = freqstatistics(cfg, fr, fr);<br />averaging over 3 channels<br />selected 50 time bins<br />selected 41 frequency bins<br />Warning: PACK can only be used from the MATLAB command line.<br />> In fieldtrip/private/prepare_timefreq_data at 305<br />  In fieldtrip/private/statistics_wrapper at 167<br />  In freqstatistics at 44<br />??? Undefined function or method 'neighbourselection' for input arguments of type<br />'struct'.<br /><br />Error in ==> statistics_wrapper at 181<br />    cfg = neighbourselection(cfg,varargin{1});<br /><br />Error in ==> freqstatistics at 44<br />[stat] = statistics_wrapper(cfg, varargin{:});<br />----------------------------------<br />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. See also <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <a href="http://www.ru.nl/neuroimaging/fieldtrip." target="_blank">http://www.ru.nl/neuroimaging/fieldtrip.</a><br /><br /><br /><br />----------------------------------<br />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. See also <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <a href="http://www.ru.nl/neuroimaging/fieldtrip." target="_blank">http://www.ru.nl/neuroimaging/fieldtrip.</a><br /><br />----------------------------------<br />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. See also <a href="http://listserv.surfnet.nl/archives/fieldtrip.html" target="_blank">http://listserv.surfnet.nl/archives/fieldtrip.html</a> and <a href="http://www.ru.nl/neuroimaging/fieldtrip." target="_blank">http://www.ru.nl/neuroimaging/fieldtrip.</a><br /></div></blockquote></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>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>