Remove dulpicate rows of cell array
5 ビュー (過去 30 日間)
古いコメントを表示
Hi,
i need to remove duplicated rows of cell array and keep the row only one time.
For example from array 3x5:
{'800AL'} {'800AL'} {'800AL'} {'800AL'} {'800AL'}
{'700AL'} {'700AL'} {'700AL'} {'700AL'} {'700AL'}
{'800AL'} {'800AL'} {'800AL'} {'800AL'} {'800AL'}
i would like to keep a table with dimension 2x5:
{'800AL'} {'800AL'} {'800AL'} {'800AL'} {'800AL'}
{'700AL'} {'700AL'} {'700AL'} {'700AL'} {'700AL'}
I tried the unique function but i can't keep the whole row.
Any idea on that?
Thanks in advance
0 件のコメント
回答 (1 件)
Awais Saeed
2021 年 12 月 9 日
編集済み: Awais Saeed
2021 年 12 月 9 日
C = {{'800AL'} {'800AL'} {'800AL'} {'800AL'} {'800AL'}
{'700AL'} {'700AL'} {'700AL'} {'700AL'} {'700AL'}
{'800AL'} {'800AL'} {'800AL'} {'800AL'} {'800AL'}};
cell2str = string(C); % convert cell to string
unique(cell2str, 'rows', 'stable')
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!