Deleting sepecific character from cell array
조회 수: 11 (최근 30일)
이전 댓글 표시
Hi Helpers,
I have a cell array in which some cell has " that I would like to delete such as, '"22000' or '"contig_2012'. (I want it as '22000' or 'contig_2012')
Will be great if you could help me to delete all of them from the cell.
Thanks, Shilo
댓글 수: 0
채택된 답변
Daniel Shub
2013년 1월 16일
This sounds like a job for a regular expression (albeit a simple one)
x = {'"22000'; '"contig_2012'; 'abc'};
regexprep(x, '"', '')
댓글 수: 0
추가 답변 (1개)
Azzi Abdelmalek
2013년 1월 15일
편집: Azzi Abdelmalek
2013년 1월 15일
% in this example we rmove '00' and '123'
A={'123' '1234' '12345' '11' '00'};
idx=cellfun(@(x) isequal(x,'00') | isequal(x,'123'),A);
A(idx)=[]
댓글 수: 3
Muhammad Usman Saleem
2017년 11월 5일
This answer is for cell array of {1,5} what about array of {31,6} ?
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!