strcmp function using wildcards
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sermet OGUTCU
le 24 Nov 2021
Réponse apportée : Stephen23
le 24 Nov 2021
data= 336950 x 2 table
I try to find all rows in data containing "G[0-9][0-9]" such as G01, G09, G33 and etc. I tried the following code:
G_index=find(strcmp('G**',data(:,2)));
but ** cannot be recognized as wildcards.
0 commentaires
Réponse acceptée
Stephen23
le 24 Nov 2021
T = cell2table({'A','XXX';'B','G22';'C','G13';'D','G1234';'E','YYY';'F','G01'})
idx = ~cellfun(@isempty,regexp(T.Var2,'^G\d\d$','once'))
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Tables 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!