[FieldTrip] Error in prepare_freq_matrices.m ?

andrea brovelli andrea.brovelli at univ-amu.fr
Mon Feb 4 09:22:17 CET 2013


Dear all,

I have an error while running ft_sourceanalysis. I am analysing a data  
set over a frequency range which includes 100 frequencies and 60  
trials. I get an error due to the definition of the variable Ntrials,  
which as far as I understand, it is done in prepare_freq_matrices.m at  
lines 76 -> 85:

-------------------------------------------------
% the time-frequency latency has already been squeezed away (see above)
if strcmp(freq.dimord, 'chan_freq')
   Ntrials = 1;
elseif strcmp(freq.dimord, 'rpt_chan_freq')
   Ntrials = length(freq.cumtapcnt);
elseif strcmp(freq.dimord, 'rpttap_chan_freq')
   Ntrials = length(freq.cumtapcnt);
else
   error('unrecognized dimord for frequency data');
end
-------------------------------------------------

If the number of trials is less than the number of frequencies,  
Ntrials = length(freq.cumtapcnt) should be replaced by Ntrials =  
size(freq.cumtapcnt,1);

It is the case ?

Thanks a lot

Andrea



More information about the fieldtrip mailing list