<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div>
<p align="left">Hello!</p>
<p align="left"><br>
</p>
<p align="left">Short introduction as this is my first email to this mailing list: I am Erika, 28, master student of neurocognitive psychology in Germany. I am analyzing MEG data for my master thesis and would like to perform automatic artifact rejection using
<span>ft_artifact_zvalue</span>. This has worked in the past, but now I get the error:</p>
<p align="left"><br>
</p>
<div>"Undefined function or variable 'peaks'.<br>
Error in ft_artifact_zvalue (line 594)<br>
  cfg.artfctdef.zvalue.peaks=peaks'; "</div>
<div><br>
</div>
<div>I call the funciton as <span>[cfg, artifact] = ft_artifact_zvalue(cfg, data)</span>.</div>
<div>My cfg is comprised of:</div>
<div>
<div>                cfg=[];<br>
                cfg.artfctdef.zvalue.channel = 'MEG';<br>
                cfg.artfctdef.zvalue.cutoff = 7;<br>
                cfg.artfctdef.zvalue.trlpadding = 0;<br>
                cfg.artfctdef.zvalue.artpadding = 0;<br>
                cfg.artfctdef.zvalue.fltpadding = 0;<br>
                cfg.artfctdef.zvalue.interactive = 'no';<br>
                cfg.artfctdef.zvalue.artfctpeak  = 'yes';</div>
and my data is segmented and filtered MEG data:</div>
<div>
<div>hdr: [1×1 struct]<br>
label: {200×1 cell}<br>
time: {1×60 cell}<br>
trial: {1×60 cell}<br>
fsample: 1000<br>
sampleinfo: [60×2 double]<br>
trialinfo: [60×1 double]<br>
grad: [1×1 struct]<br>
elec: [1×1 struct]<br>
cfg: [1×1 struct]</div>
</div>
<div><br>
</div>
<div>Googling hasn't brought me any closer to a solution. I tried removing fieldtrip from the path, adding it again, and calling ft_defaults again. I also downloaded a new version of fieldtrip.</div>
<div>Does anyone have an idea what might be the problem here?</div>
<div>Thanks for aswers in advance!</div>
<div><br>
</div>
<div>Kind regards</div>
Erika</div>
<br>
<p></p>
</div>
</body>
</html>