<div dir="ltr"><div><br></div><div>The documentation says: </div><div><br></div><div><pre class="gmail-code" style="padding:0.5em;margin-top:0px;margin-bottom:1em;font-size:12px;border:1px dashed rgb(204,204,204);color:rgb(0,0,0);overflow:hidden;font-family:consolas,"andale mono",menlo,monaco,monospace;background-color:rgb(247,249,250);white-space:pre-wrap;width:640px;text-align:justify">cfg.trials       = 'all' or a selection given as a 1xN vector (default = 'all')</pre></div><div>In your case, cfg.trials should be as 1xN vector containing trials' index e.g. cfg.trials = [1:9] or cfg.trials = [1,2,3,6,8,45,67,69,89].</div><div><br></div><div>Thanks,</div><div><br></div><div>jb</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 25, 2017 at 4:00 PM, Marek <span dir="ltr"><<a href="mailto:marek-b@wp.pl" target="_blank">marek-b@wp.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I've got the following problem. When I want to reduce the number of trials in my dataset using syntax:<br>
<br>
cfg = [];<br>
cfg.trials = [1 1 1 1 1 1 1 1 1];<br>
fdata_freq_stim = ft_redefinetrial(cfg, data_freq_stim);<br>
<br>
I get the output messages:<br>
the input is raw data with 40 channels and 30 trials<br>
selecting 9 trials<br>
the call to "ft_selectdata" took 0 seconds<br>
the call to "ft_redefinetrial" took 0 seconds<br>
<br>
but the resulting variable contains only one trial. In fact, the same output occurs with any setting of cfg.trials, if it contains only ones. The resulting variable contains only one trial, while the message correctly reports the number of selected trials.<br>
<br>
When using<br>
<br>
cfg.trials = [1 0 0 1 1];<br>
<br>
an error message appears:<br>
the input is raw data with 40 channels and 30 trials<br>
selecting 9 trials<br>
Subscript indices must either be real positive integers or logicals.<br>
<br>
What is wrong here? Any help would be appreciated.<br>
<br>
MATLAB Version: 8.6.0.267246 (R2015b)<br>
FieldTrip version: fieldtrip-20170224<br>
<br>
Thanks,<br>
Marek<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">
<font color="#666666">
Jean-Baptiste Eichenlaub, PhD<br>
MGH - Harvard Medical School<br>
Boston, US<br>
<a href="mailto:jb.eichenlaub@gmail.com" target="_blank">jb.eichenlaub@gmail.com</a><br>
<a value="+18576543879">(1)857-654-3879</a></font></div></div>
</div>