How to find overlapping between multiple cell array in a row?
4 ビュー (過去 30 日間)
古いコメントを表示
I have list of cell array (in row) as follow:
'1,2' '1,2,3' '1,4' '2,3' '4,5,2' '3,2,5,4' '2,4,1,5' '4,5'
I want to find overlapping cell arrays from the row and delete them. I am going to have huge list of these row cell arrays, so I need a efficient way to find the overlapping.
there are 2 Overlapping procedures:
1 for existing sequence and the other for flip of sequence
for existing sequence means:
Ex. '1,2' has overlapping with '1,2,3' , so '1,2' has to be removed '2,3' has overlapping with '1,2,3' also, so '2,3' will be removed from the list also.
for flip of sequence means , if searching for '1,4, then it needs to serach for '4,1' also because '1,4' = '4,1'
'1,4' has over lapping with '2,4,1,5' so '1,4' also removed
'4,5,2' has overlap with '3,2,5,4', because flip of '4,5,2'='2,5,4' which has overlapping with '3,2,5,4'
if someone can help me with these problem I appreciate.
Regards
0 件のコメント
回答 (1 件)
Udit Gupta
2014 年 5 月 29 日
Matlab allows set operations. I can think of doing it a few ways using "ismember" or "union" methods. Please see
Let us know if you need more help.
2 件のコメント
Udit Gupta
2014 年 5 月 29 日
I am confused by you explanation but can you sort both the arrays into temporary variables before using set operations.
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!