How to extract the all combinations of array (permutations combinations)
Afficher commentaires plus anciens
Hi,
I have a matrix as below:
A Success
B Failure
C Success
A Success
B Success
C Success
I want to count how many time B appeared after A or A appeared after A or C appeared after B (for example: i-1 should be A, and i should B: so it counted as AB). The resultant combinations are as shown below: So, again I want to count how many time A appeared after A, B appeared after A, B appeared after B, C appeared after B (or C,or A,or D)etc.
AA AB AC
BA BB BC
CA CB CC
My out put should be: Out_sucess (only succeefull combinations):
0 1 0
0 0 2
1 0 0
Out_Fail(Failed combinations):
0 1 0
0 0 0
0 0 0
Kindly help how do I get these out puts
4 commentaires
dpb
le 13 Août 2015
Going to have to give more specifics on how you come up with the decision (definition of "success"). You have 'AA' as 0 but there are combination of entries that match; same for 'AC'. You also have 0 for the same combination of both success and fail--that's not consistent it would seem.
James Tursa
le 14 Août 2015
How is your original matrix stored? As a vector of characters?
the cyclist
le 14 Août 2015
Modifié(e) : the cyclist
le 14 Août 2015
@dpb, I think he/she is only looking at "nearest neighbor" pairs, and basing the classification on the success/failure of the 2nd member of the pair. (At least, this gives the quoted result.)
Kanakaiah Jakkula
le 15 Août 2015
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Lengths and Angles 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!