[FieldTrip] Data Interpolation

Eelke Spaak eelke.spaak at donders.ru.nl
Fri Sep 5 14:22:09 CEST 2014


The error is here:

 electric_window_idx = [nearest(epData.time{1},electric_window(1))
nearest(epData.time{1},electric_window(2))];

Find the missing 's' ;)

On 5 September 2014 14:06, Caspar, Emilie <e.caspar at ucl.ac.uk> wrote:
> 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
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list