Uppercase string from the cell array
Mostra commenti meno recenti
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 Commento
Stephen23
il 12 Ago 2015
+1 for a clear question with input and output examples.
Risposta accettata
Più risposte (1)
Azzi Abdelmalek
il 12 Ago 2015
Modificato: Azzi Abdelmalek
il 12 Ago 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)
1 Commento
Gopalakrishnan venkatesan
il 12 Ago 2015
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!