mercredi 25 juillet 2018

how to find repeated patterns of numbers in rows of a matrix in matlab

I've searched the forum for my enquiry but I couldn't find anything related. What I'm looking for is this:

Say that I have a matrix with N rows (N is known) containing the same numbers but in different order in each row. I'd like to detect patterns of numbers in the different rows. For example if I have a matrix as below

1   2   3   8   9   7   4   5   6
1   3   2   7   8   9   4   5   6
1   2   3   5   6   7   4   9   8
1   2   3   7   8   6   4   5   9
1   2   3   4   5   6   7   8   9
1   2   3   7   8   9   4   5   6
1   3   2   4   5   6   7   8   9

a pattern is the sequence 1-2-3 in the rows 1,3,4,5,6 appeared 5 times, another pattern is the sequence 4-5-6 in the rows 1,2,5,6,7 appeared 5 times. Is there anything for this in matlab?

I hope I've explained well enough my question.

Aucun commentaire:

Enregistrer un commentaire