Skip to content

Commit e1f4ca9

Browse files
committed
twoClusterWeighting: placement of switch weights was inconsistent with locations where downsampled data were taken from, which causes a slight misalignment for some downsample levels, and also a crash due to wrong indexing for some valid input parameters (e.g. downsample 5 for 60 Hz data and a .2 s window)
1 parent 951f48b commit e1f4ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/I2MC/twoClusterWeighting.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
% get nearest samples of switch and add weight
145145
weighted = [switches{1}*switchesw(1); 0];
146146
for p=1:nd
147-
j = find(switches{p+1})*downsamples(p);
147+
j = idxs{p}(~~switches{p+1});
148148
for o=0:downsamples(p)-1
149149
weighted(j+o) = weighted(j+o) + switchesw(p+1);
150150
end

0 commit comments

Comments
 (0)