Filter out combinations of letters
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Scott MacKenzie
il 8 Lug 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?
Risposta accettata
Jonas
il 8 Lug 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 Commenti
Jonas
il 8 Lug 2021
you can directly add it in regexprep
in=['D3I2C7';'B4H8R1';'Z3G4K2'];
out=regexprep(cellstr(in),{'D.I.C.','B.H.R.'},'');
vertcat(out{:})
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Time Series Collections in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!