How to find unique lines in cell arrays
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
How to find unique lines in the next cell array:
15 'm'
18 'm'
15 'm'
So the result will be:
15 'm'
18 'm'
0 Commenti
Risposta accettata
Azzi Abdelmalek
il 7 Ago 2013
use unique function
2 Commenti
Azzi Abdelmalek
il 7 Ago 2013
a={15 'm'; 18 'm'; 15 'm';13 'r';15 'm'}
b=cellfun(@num2str,a,'un',0)
c=arrayfun(@(x) horzcat(b{x,:}),(1:size(a,1))','un',0)
[idx,idx]=unique(c)
out=a(idx,:)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Types in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!