Cannot support cell arrays containing cell arrays or objects.
44 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carina
am 30 Okt. 2014
Kommentiert: TraxexFly
am 13 Okt. 2016
I created a cell Array like this
A{1} = {'aa','b','d','aa'};
A{2} = {'c','d','aa'};
A{3} = {'bb','aa','bb','aa'};
now i wanna find the unique words
b=cell2mat(A)
unique(b)
but i get this Error: Error using cell2mat (line 52) Cannot support cell arrays containing cell arrays or objects.
I'm fairly new to matlab. Am I doing something wrong here?
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 30 Okt. 2014
You can use comma-separated list expansion here:
B = [A{:}]
2 Kommentare
Weitere Antworten (1)
Orion
am 30 Okt. 2014
Hi,
the aim of cell2mat is to convert a cell that contains numbers into an array (matrix).
your cell contains strings, so it can't work.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!