Uppercase string from the cell array
古いコメントを表示
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 日
+1 for a clear question with input and output examples.
採用された回答
その他の回答 (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)
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!