Back to the main page.

Bug 1968 - Error in prepare_freq_matrices.m ?

Status CLOSED FIXED
Reported 2013-02-04 14:01:00 +0100
Modified 2013-02-07 14:08:10 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Andrea Brovelli - 2013-02-04 14:01:55 +0100

Dear all, 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); Thanks a lot Andrea


Jan-Mathijs Schoffelen - 2013-02-07 13:06:00 +0100

svn commit -m "changed length() into size( ,1) to avoid crash when nrpt<nfreq: thanks to Andrea" prepare_freq_matrices.m Sending prepare_freq_matrices.m Transmitting file data . Committed revision 7451. @Andrea: could you test whether it works OK?


Andrea Brovelli - 2013-02-07 14:06:43 +0100

(In reply to comment #1) I have tried the moditfication you just made on my version of Fieldtrip and it works. Thanks Jan-Mathijs, I'll download the latest version now. bye Andrea


Jan-Mathijs Schoffelen - 2013-02-07 14:08:10 +0100

my pleasure. closing this bug