<div dir="ltr"><p class="MsoNormal">Dear all<span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal">Hi,<span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal">I am trying to remove
ecg artifact from some neuromag MEG data using the “<span style="font-size:10pt;font-family:"courier new";color:black">ft_artifact_ecg</span>” method, but unfortunately I encounter the following error:</p><p class="MsoNormal"><span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:arial,sans-serif;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">"Undefined function or
variable "labelmlt"."</span><span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:arial,sans-serif;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">When I traced the code, I
found that the error is raised from “ft_channelselection” method. In this
method, line </span><span style="font-size:9.5pt;line-height:107%;font-family:arial,sans-serif;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">340,
the value of variable "findmlt" is set to some index, in my code to 1,
via the following code snippet:<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-family:"courier new"">findmlt        =
find(strcmp(channel, 'MLT'));<span></span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Then in line 428 of
method <span style="font-size:9.5pt;line-height:107%;font-family:arial,sans-serif;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">“ft_channelselection”, the following line of
code produces the above error:<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-family:"courier new"">if findmlt,        channel
= [channel; labelmlt]; end<span></span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">I found that the only
place in method “<span style="font-size:9.5pt;line-height:107%;font-family:arial,sans-serif;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">ft_channelselection”
</span>where variable “<span style="font-family:"courier new"">labelmlt</span>” is set is in line 249 which is not accessible in my code as it seems to only
be accessible for the CTF file format.<span></span></p>

<p class="MsoNormal">To solve the problem, I
just copied lien 249 at the end of the switch case statements, i.e. after line
298 as follows:<span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-family:"courier new"">labelmlt  =
datachannel(strncmp('MLT', </span><b><span style="font-size:14pt;font-family:"courier new"">datachannel</span></b><span style="font-family:"courier new"">,
length('MLT')));<span></span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">and I replaced the bold “<b><span style="font-size:14pt;line-height:107%;font-family:"courier new"">datachannel</span></b>" variable with “channel” variable and this
way the error was solved, but I am not really sure what I have done is correct
or not. Would you please help me with this issue?<span></span></p>

<p class="MsoNormal">I had the same problem
with labelmrt and I solved it in the same way.   <span></span></p><p class="MsoNormal"><br></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-family:arial,sans-serif">Besides, I wonder if there is
any better and more straightforward way</span><span style="font-family:"courier new";color:black"> </span><span style="font-family:arial,sans-serif">to remove ECG artifact as even after solving
the above errors, I have to manually answer to the following line at each
run:<span style="font-size:12pt"></span></span></p><p class="MsoNormal"><br></p><p class="MsoNormal">current  zvalue threshold = 3.000</p><p class="MsoNormal">keep the current value (y/n) ?</p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Best,<span></span></p>

<p class="MsoNormal">Narjes<span></span></p>
</div>