Back to the main page.

Bug 579 - ft_checkdata can get the wrong dim with length() on line 761; use size() instead

Reported 2011-04-13 00:57:00 +0200
Modified 2011-04-20 14:01:17 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Matt Mollison - 2011-04-13 00:57:41 +0200

Using fieldtrip-20110411 on Matlab 2010b. I had some subjects with low trial counts and noticed that ft_connectivityanalysis was failing on them. I won't go into too many details (but can provide them if needed), but suffice it to say that when the number of trials (rpttap) is less than the number of frequencies (the dimensions of data.cumtapcnt are trials by frequencies), line 761 in ft_checkdata will take the larger number (i.e., # of frequencies) and will error in the for loop at line 803 because it's trying to index trials. Thus, line 761 in ft_checkdata: nrpt = length(data.cumtapcnt); should instead be: nrpt = size(data.cumtapcnt,1); Let me know if you need more details. Matt Mollison

Jan-Mathijs Schoffelen - 2011-04-13 08:54:34 +0200

Thanks Matt, let's leave the details for the time being ;o). I'll fix it in a minute.