Cannot support cell arrays containing cell arrays or objects.
17 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(1 个)
Orion
2014-10-30
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!