Identifying sequences in a Matrix
4 views (last 30 days)
Currently working on a sequential ligament cutting sequence where we are trying to compare outcomes between similar clusters of sequential ligament cuts. For example we have
- Experiment 1: Lig A Lig B Lig C Lig D Lig E
- Experiment 2: Lig A Lig B Lig E Lig B Lig C
- Experiment 3: Lig A Lig E Lig B Lig C Lig D
With a separate matrix that are the measured outcomes corresponding to the sequence described
In comparing like clusters, we would like to compare outcomes that are similar i.e.
- Compare outcome after ligament A sectioning for all three groups (timepoint 1)
- Compare outcome after ligament A and B sectioning for Experiments 1 and 2 (timepoint 2)
- Compare outcome after ligament A/B/E sectioning with A/E/B in Experiments 2 and 3 (timepoint 3, order does not matter)
So far I've seen the diff function being used to determine whether, for example, ligament A and B are clustered, or ligament B and C are clustered, but this runs into problems when comparisons are made between A and C vs. C and E (both diff will produce 2). So this is clearly not a solution.
Any thoughts on how to tackle this? Thanks!
Cedric Wannaz on 11 Oct 2017
You can find sequences using STRFIND, even when you are dealing with numbers:
>> seq_str = 'ACEBAECE' ;
>> strfind( seq_str, 'CE' )
>> strfind( seq_num, [3,5] )