i want to determine common sub sequence on array
3 views (last 30 days)
pfb on 29 Apr 2015
You can use the builtin function "intersect"
i = intersect(a,b);
i = intersect(i,c);
i = intersect(i,h)
The last i should contain only the elements common to all sequences.
If your sequences have all the same length, you can put them in a matrix, and loop over its rows. Otherwise you can build a cell array, so that you can loop, as opposed to writing one instruction for each intersection you need to do.