Filter out combinations of letters
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have created around 7 Million Combinations of Letters and Number.
This how the 7077888×6 char matrix looks like (i did not include the number 0 (zero) and 1 (one).
'A2A2A2'
'A2A2A3'
.....
'Z9Z9Z9'
Now i want to delete the rows, which include certain combinations of letters. Let's say I want to delete all the rows, which include the letters
"D I C" in that exact order. I have tried to use the code
indices = find(C =='D2I2C2');
to manually find the row in which one of the combination is located, but that did not work.
I hope you can help me out!
Thank you very much!
2 commentaires
Scott MacKenzie
le 8 Juil 2021
Your question is confusing. In your example, is the letter sequence D, space, I, space, C? If not, explain. If so, why are you using the letter sequence D2I2C in the find function?
Réponse acceptée
Jonas
le 8 Juil 2021
do you mean the case if the three letters that occur are D, I and C?
in=['D3I2C7';'B4H8R1'];
out=regexprep(cellstr(in),'D.I.C.','');
vertcat(out{:})
2 commentaires
Jonas
le 8 Juil 2021
you can directly add it in regexprep
in=['D3I2C7';'B4H8R1';'Z3G4K2'];
out=regexprep(cellstr(in),{'D.I.C.','B.H.R.'},'');
vertcat(out{:})
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Time Series Collections dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!