[FieldTrip] Data Interpolation

Caspar, Emilie e.caspar at ucl.ac.uk
Fri Sep 5 14:06:36 CEST 2014

Dear Fieldtrippers,

I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote :

        cfg                     = [];
        epData                  = ft_redefinetrial(epData_cfg, allData_prepross);
        fname = [contfname];
        save([subjPath filesep fname '.mat'], 'epData');

        electric_windows = [0.002 0.013];
        electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))];
        for i=1:numel(epData.trial) % Loop through all trials
            epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans

        cfg.method = 'linear';
        cfg.prewindow   = 0.01;
        cfg.postwindow  = 0.01;
        interpoldata  = ft_interpolatenan(cfg, epData);

But I get the following error:
Undefined function 'electric_window' for input arguments of type 'double'.

Even if I see what the problem is, I don't know how to solve it without doing any mistakes.

Thank you!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140905/02395d8e/attachment-0001.html>

More information about the fieldtrip mailing list