Deleting sepecific character from cell array
7 ビュー (過去 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!