Skip to content

Commit bfc6741

Browse files
committed
ENH - ensure datachannel to be a column vector to avoid unexpected behaviour
1 parent 5b0dfc9 commit bfc6741

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

contrib/spike/ft_spike_xcorr.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
doShiftPredictor = strcmp(cfg.method, 'shiftpredictor'); % shift predictor
129129

130130
% determine the corresponding indices of the requested channel combinations
131-
cfg.channelcmb = ft_channelcombination(cfg.channelcmb, spike.label,true);
131+
cfg.channelcmb = ft_channelcombination(cfg.channelcmb, spike.label(:), true);
132132
cmbindx = zeros(size(cfg.channelcmb));
133133
for k=1:size(cfg.channelcmb,1)
134134
cmbindx(k,1) = strmatch(cfg.channelcmb(k,1), spike.label, 'exact');

utilities/ft_channelcombination.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
if nargin<3 || isempty(includeauto), includeauto = 0; end
5959
if nargin<4 || isempty(dirflag), dirflag = 0; end
6060

61+
% ensure that datachannel is a column vector
62+
datachannel = datachannel(:);
63+
6164
if ischar(channelcmb) && strcmp(channelcmb, 'all')
6265
% make all possible combinations of all channels
6366
channelcmb = {'all' 'all'};

0 commit comments

Comments
 (0)