Uppercase string from the cell array
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gopalakrishnan venkatesan
le 12 Août 2015
Modifié(e) : Stephen23
le 12 Août 2015
I have a cell array a = {'AA_DFA_DD' ,'DSFA_dfaf' ,'DDDD' , 'DFE1' ,'dfs_DD'}
How can extract only the upper case string from the cell array
my answer should be {'AA_DFA_DD',[],'DDDD','DFE1',[]}
How can i do this?
Thanks a lot
1 commentaire
Réponse acceptée
Stephen23
le 12 Août 2015
Modifié(e) : Stephen23
le 12 Août 2015
regexp(a,'^[^a-z]+$','match')
Plus de réponses (1)
Azzi Abdelmalek
le 12 Août 2015
Modifié(e) : Azzi Abdelmalek
le 12 Août 2015
out=a(cellfun(@(x,y) isequal(x,y),a,upper(a)))
or
out=cell(size(a))
idx=cellfun(@(x,y) isequal(x,y),a,upper(a))
out(idx)=a(idx)
Voir également
Catégories
En savoir plus sur Characters and Strings 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!