Deleting sepecific character from cell array
47 次查看(过去 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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!