<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal" style="line-height:16.5pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">Hi Fieldtrip community,
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">I’m reaching out with an issue I receive when running ft_entropyanalysis.
 The error I receive pertains to the trial limits/how a trial is defined using ft_redefinetrial.
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">My data input to ft_entropyanalysis is a raw struct (or</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">
 rather a</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"> dummy raw struct where I reshaped previous output to fit the ft_rawdatatype), with the essential fields of trial, time,
 and label.</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">
<span lang="EN-US">My data has</span></span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"> 145 trials, so my trial and time fields are 1x145 cells. I parcellated MEG data in my project
 based on the Brainnetome atlas with 246 parcels, and the trials have 1018 timepoints. The fields in the trial 1x145 cell are therefore 246x1018 doubles, and in the time cell 1x1018 doubles. These shapes of the data should fit the desired input shapes.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">I receive the following error when I run the function:<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">‘’’<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">Index in position 1 exceeds array bounds (must not exceed 1).<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">Error in ft_redefinetrial (line 180)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">    if cfg.toilim(i,1)>data.time{i}(end) ||<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">    cfg.toilim(i,2)<data.time{i}(1)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">Error in ft_entropyanalysis (line 279)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">        data_sel = ft_redefinetrial(tmpcfg, data_filt);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">Error in run_entropy (line 65)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">mmse = ft_entropyanalysis(cfg,test_entropy);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">‘’’<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">The error seems to arise
</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">as my</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"> requested cfg.toilim
</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">is</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"> beyond the timepoints that are in the
 data.</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB">
<span lang="EN-US">The issue seems to arise on the last trial (145) for some reason, hence why
<i>i </i>is 145. M</span></span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">y time cell
</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">contains</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"> identical time points for all
 trials. Each 1x1018 double in the time cell contains</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"> the same</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">
 time points in equal 2-second intervals starting from 0. There is no stimulus since I'm using resting-state data, but there are still arbitrary trials/start times for these trials.</span><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">
</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:16.5pt"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">Any suggestion will be greatly appreciated, thanks a lot in advance!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#1E1F21;background:white">Marta</span><o:p></o:p></p>
</div>
</body>
</html>