<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Thanks Eelke
<div><br>
</div>
<div>If this can help someone else, here is the correct code:</div>
<div><br>
</div>
<div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "><span class="Apple-tab-span" style="white-space:pre"></span>arrondi=roundn(size(cleandata.trial,2)/2, 0);</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        a = randperm(size(cleandata.trial,2));</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        r1=a(1:arrondi);</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        r2=a(arrondi+1:end);</div>
<p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px; ">
        <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        cfg = [];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        cfg.trials = r1;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        avgFCIndexHALF1 = ft_timelockanalysis(cfg, cleandata);</div>
<p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px; ">
        <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        cfg = [];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        cfg.trials = r2;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; ">        avgFCIndexHALF2 = ft_timelockanalysis(cfg, cleandata);</div>
<p style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px; ">
        <br class="webkit-block-placeholder">
</p>
<div><br>
</div>
<div><br>
</div>
<div>Best, </div>
<div><br>
</div>
<div>Emilie</div>
<div>
<div apple-content-edited="true">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<p class="MsoNormal"><span lang="FR">---------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="FR">Emilie Caspar<o:p></o:p></span></b></p>
<div><span lang="FR"> </span><br class="webkit-block-placeholder">
</div>
<p class="MsoNormal"><span lang="FR">Aspirante FNRS - Ph.D. Student <o:p></o:p></span></p>
<div><span lang="FR"> </span><br class="webkit-block-placeholder">
</div>
<p class="MsoNormal"><span lang="FR">Consciousness, Cognition & Computation Group (CO3)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">Centre de Recherche Cognition et Neurosciences (CRCN)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">ULB Neurosciences Institute (UNI)<o:p></o:p></span></p>
<div><span lang="FR"> </span><br class="webkit-block-placeholder">
</div>
<p class="MsoNormal"><span lang="FR">Université Libre de Bruxelles <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">Av. F.-D. Roosevelt, 50 <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">1050 Bruxelles <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">BELGIUM <o:p></o:p></span></p>
<div><span lang="FR"> </span><br class="webkit-block-placeholder">
</div>
<p class="MsoNormal"><span lang="FR">Voice : +32 2 650 32 95 <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">mail : <a href="mailto:ecaspar@ulb.ac.be">ecaspar@ulb.ac.be</a> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">office: DB10-138 <o:p></o:p></span></p>
</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br>
</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
<div>
<div>Le 21 nov. 2014 à 10:29, Eelke Spaak <<a href="mailto:eelke.spaak@donders.ru.nl">eelke.spaak@donders.ru.nl</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Dear Emilie,<br>
<br>
You are not providing a FT data structure to ft_timelockanalysis<br>
(which you should), instead you are providing the raw cell array of<br>
trials (which you shouldn't). Hence, FT complains that the data is not<br>
in a structure that it can work with.<br>
<br>
There is a cfg-option cfg.trials, which you might like to use instead.<br>
<br>
Best,<br>
Eelke<br>
<br>
On 21 November 2014 10:09, Caspar, Emilie <<a href="mailto:e.caspar@ucl.ac.uk">e.caspar@ucl.ac.uk</a>> wrote:<br>
<blockquote type="cite">Dear Fieldtrippers,<br>
<br>
I have a sample of 350 trials for one condition, but for statistical<br>
analysis reasons I would like to split randomly this sample in two and<br>
average these two parts.<br>
<br>
so, I used the "randsample" matlab function which seems to work very well<br>
and then I averaged this selected sample:<br>
<br>
       randomhalf = randsample(cleandata.trial, 175);<br>
       avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf);<br>
<br>
<br>
However, I have the following error message :<br>
<br>
Error using ft_checkdata (line 366)<br>
This function requires raw or comp data as input.<br>
<br>
Error in ft_timelockanalysis (line 105)<br>
data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes',<br>
'hassampleinfo', 'yes');<br>
<br>
Does anyone have a solution to fix the problem?<br>
<br>
Thank you very much!<br>
<br>
Emilie<br>
<br>
<br>
</blockquote>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>