Skip to content

Commit 951f48b

Browse files
committed
twoClusterWeighting: removed unneeded cell
1 parent c8aabe8 commit 951f48b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

functions/I2MC/twoClusterWeighting.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,19 @@
134134

135135
% detect switches and weight of switch (= 1/number of switches in
136136
% portion)
137-
[switches,switchesw] = deal(cell(1,nd+1));
137+
[switches] = deal(cell(1,nd+1));
138+
switchesw = nan(1,nd+1);
138139
for p=1:nd+1
139140
switches{p} = abs(diff(IDL_d{p}));
140-
switchesw{p} = 1/sum(switches{p});
141+
switchesw(p) = 1/sum(switches{p});
141142
end
142143

143144
% get nearest samples of switch and add weight
144-
weighted = [switches{1}*switchesw{1}; 0];
145+
weighted = [switches{1}*switchesw(1); 0];
145146
for p=1:nd
146147
j = find(switches{p+1})*downsamples(p);
147148
for o=0:downsamples(p)-1
148-
weighted(j+o) = weighted(j+o) + switchesw{p+1};
149+
weighted(j+o) = weighted(j+o) + switchesw(p+1);
149150
end
150151
end
151152

0 commit comments

Comments
 (0)