2013-05-30 72 views

回答

5

您可以將電池串fromat轉換:

B = cellfun(@(x)(mat2str(x)),A,'uniformoutput',false); 

然後用unique像往常一樣:

[C,ia] = unique(B) 

然後使用索引ia指向唯一細胞與:

A{ia} 
1

如果你寫A如下:

A={[1,3,4] [4,7] [1,3,4]; [3,6] [4,7] []; [1,3,4] [4,7] [4]}; 
tmp = cellfun(@(x)(num2str(x)),A,'uniformoutput',false); 
unique(tmp); 
相關問題