[FieldTrip] ft_freqgrandaverage with cfg.inputfile not possible

Steinmann, Iris iris.steinmann at med.uni-goettingen.de
Thu Oct 1 17:38:25 CEST 2015

Hi everybody,
 I have a problem using the cfg.inputfile option with the ft_freqgrandaverage function.
 When I declare an cfg.inputfile and call the ft_freqgrandaverage(cfg) with only the cfg structure as an argument
I get an error: ' cfg.inputfile should not be used in conjunction with giving input data to this function'
 as if I would call the function with an inputfile AND a data structure (what is in fact not the case)
 here a short example:
I calculated the time-frequency-spectra for all my subjects (like that:  TFR1 = ft_freqanalysis(cfg, data))
Now I  wanne use the ft_freqgrandaverage function to average time-frequency-spectra over subjects.
 It worked great when I call the function like that:
 % code start ==================================================
 cfg = [];
cfg.parameter = 'powspctrm';
grdavg_spec = ft_freqgrandaverage(cfg, TFR1, TFR2, TFR3, TFR4, ...);

% code end ====================================================

but I get an error message when I save all my TFRs from single subjects
in a cell array to use the cfg.inputfile option
 % code start ==================================================
 all_subjects = {TFR1; TFR2; TFR3; TFR4; ....};
save 'all_subject_file' 'all_subjects';

 cfg = [];
cfg.parameter = 'powspctrm';
cfg.inputfile = 'all_subject_file';
grdavg_spec = ft_freqgrandaverage(cfg);

 % code end ====================================================
 Error message:
 Error using ft_preamble_loadvar (line 46)
cfg.inputfile should not be used in conjunction with giving input data to this function

Error in ft_preamble (line 56)
evalin('caller', ['ft_preamble_' cmd]);

Error in ft_freqgrandaverage (line 63)
ft_preamble loadvar varargin

 Would be nice if someone could help me!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151001/f241664f/attachment-0001.html>

More information about the fieldtrip mailing list