How to find overlapping between multiple cell array in a row?
3 次查看(过去 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!