Uppercase string from the cell array
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Stephen23
2015 年 8 月 12 日
編集済み: Stephen23
2015 年 8 月 12 日
regexp(a,'^[^a-z]+$','match')
その他の回答 (1 件)
Azzi Abdelmalek
2015 年 8 月 12 日
編集済み: Azzi Abdelmalek
2015 年 8 月 12 日
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)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!