You can do it with unique
. You need to convert vectors to strings, because unique
works with cell arrays of strings but not with cell arrays of numeric vectors. After unique
, you can count how many strings (vector) are repeated with histc
, and them some indexing lets you retrieve the corresponding vectors:
strcell = cellfun(@(e) num2str(e), c, 'uniformoutput', 0); %// convert to strings
[~, ii, jj] = unique(strcell); %// apply unique. Second and third outputs needed
ind = find(histc(jj,min(jj)-.5:max(jj)+.2)>1); %// which appear more than once
result = c(ii(ind)); %// indexing to obtain corresponding original vectors