mercredi 25 novembre 2015

Matlab: How to find similarity of two patterns

I have a problem to find the similarity of two patterns. I use LCS of this two pattern to represent their longest common part. For example given a pattern

P=<{School}, {Cinema}, {Park,Bank}, {Restaurant}>

and a pattern

Q=<{School, Market},{Park}, {Restaurant}>,

their longest common sequence is

LCS(P,Q)= <{School}, {Park}, {Restaurant}>.

I have to apply this to a cell array of numeric strings of different dimensions and I have a lot of difficultes: I have no idea, I can do it. I find in MAtlab function like Strcmp, Strcmpi, Strncmp, Strncmpi but they are for strings of same size; i think to use regexp but I don't know how. I have read other questions about compare strings but no-one appears to help me. Can you give me suggests?

Aucun commentaire:

Enregistrer un commentaire