<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; ">
Oh yes! scatterbrained, sorry ;)
<div>Thanks!</div>
<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"><br>
</p>
</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
<div>
<div>Le 5 sept. 2014 à 14:06, "Caspar, Emilie" <<a href="mailto:e.caspar@ucl.ac.uk">e.caspar@ucl.ac.uk</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Dear Fieldtrippers,
<div><br>
</div>
<div>I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote :</div>
<div><br>
</div>
<div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; color: rgb(37, 153, 45); ">
<br>
</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> cfg = [];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> epData = ft_redefinetrial(epData_cfg, allData_prepross);</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> fname = [contfname];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> save([subjPath filesep fname
<span style="color: #b245f3">'.mat'</span>], <span style="color: #b245f3">'epData'</span>);</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px; ">
<br>
</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> electric_windows = [0.002 0.013];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))];</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> <span style="color: #0433ff">
for</span> i=1:numel(epData.trial) <span style="color: #25992d">% Loop through all trials</span></div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan;
<span style="color: #25992d">% Replace the segment of data corresponding to our window of interest with nans</span></div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> <span style="color: #0433ff">
end</span>;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; min-height: 12px; ">
<br class="webkit-block-placeholder">
</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> cfg.method =
<span style="color: #b245f3">'linear'</span>;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> cfg.prewindow = 0.01;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> cfg.postwindow = 0.01;</div>
<div style="margin: 0px; font-size: 10px; font-family: Courier; "> interpoldata = ft_interpolatenan(cfg, epData);</div>
<div><br>
</div>
<div>But I get the following error: </div>
<div>Undefined function 'electric_window' for input arguments of type 'double'.</div>
<div><br>
</div>
<div>Even if I see what the problem is, I don't know how to solve it without doing any mistakes.</div>
<div><br>
</div>
<div>Thank you!</div>
<div><br>
</div>
<div>Emilie </div>
<div apple-content-edited="true">
<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>
_______________________________________________<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</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>