error using unique function
Ältere Kommentare anzeigen
s is a cell matrix (178000x9) I want to find the unique values of s in the first column. ID=unique(s(:,1));
I received the following error. Error using cell/unique (line 95) Input A must be a cell array of string
what could be the reason?
1 Kommentar
Sean de Wolski
am 26 Jul. 2012
If the first column is all non-numeric it would not be throwing that error. What is returned from:
iscellstr(s(:,1))
Akzeptierte Antwort
Weitere Antworten (1)
Wayne King
am 26 Jul. 2012
Bearbeitet: Wayne King
am 26 Jul. 2012
Is it a cell array of numeric values?
You can use cell2mat()
A = {1 5 9 ; 2 3 4; 2 4 5};
B = unique(cell2mat(A(:,1)));
1 Kommentar
Danielle Leblanc
am 26 Jul. 2012
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!