Skip to content

Commit 51268e5

Browse files
committed
Fixed marking multiple as good at once
1 parent 9b299c3 commit 51268e5

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

@SplitMerge/setLabel.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
% Set the selected clusters labels:
22
function setLabel(app,which)
3-
%[~,idx] = intersect(app.Data.spikes.labels(:,1),app.Data.Selected,'stable');
4-
idx = find(app.Data.spikes.labels(:,1) == app.Data.Selected);
5-
if length(idx) > 1
6-
app.Data.spikes.labels(idx(2:end),:) = [];
7-
idx = idx(1);
8-
end
3+
[~,idx] = intersect(app.Data.spikes.labels(:,1),app.Data.Selected,'stable');
4+
%idx = app.Data.spikes.labels(:,1) == app.Data.Selected;
95
app.Data.spikes.labels(idx,2) = which;
106

7+
for i = 1:length(app.Data.Selected)
8+
ids = find(app.Data.spikes.labels(:,1) == app.Data.Selected(i));
9+
if length(ids) > 1
10+
app.Data.spikes.labels(ids(2:end),:) = [];
11+
end
12+
end
1113
%pushHistory(app,'l',selected,which);
1214
end

0 commit comments

Comments
 (0)