Uppercase string from the cell array
조회 수: 8 (최근 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!