Find sequence of values in matrix (row wise)
Afficher commentaires plus anciens
Hi,
I have problem and not sure how to solve this in a good way. I have a matrix RCX with m rows of n cartesian coordinates.
RCX= [219, 232, 241, 261, 0, 0, 0, 0;
446, 455, 464, 0, 0, 0, 0, 0;
760, 767, 775, 0, 0, 0, 0, 0;
232, 241, 261, 0, 0, 0, 0, 0;
264, 275, 282, 0, 0, 0, 0, 0;
259, 268, 276, 0, 0, 0, 0, 0;
295, 309, 321, 335, 345, 351, 363, 381;
309, 321, 335, 345, 351, 363, 381, 0;]
Now I wanna find alle duplicate nonzero sequenzes in this matrix and filter them out if they are shorter as another existing. For example RCX(4,1:3) = RCX(1,2:4) and RCX(8,1:7)=RCX(7,2:8).
At the end I wanna delete the shorter sequences if they are fully covered by another and longer sequence. So RCX(4,:) and RCX(8,:) should be deleted.
(Matlab release 2015a)
Thanks a lot!
~ Kind regards,
Manuel
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!