[FieldTrip] Data Interpolation

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


Oh yes! scatterbrained, sorry ;)
Thanks!




Le 5 sept. 2014 à 14:06, "Caspar, Emilie" <e.caspar at ucl.ac.uk<mailto:e.caspar at ucl.ac.uk>> a écrit :

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
        end;

        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!

Emilie




_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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


More information about the fieldtrip mailing list