Removing the string from cell array
97 次查看(过去 30 天)
显示 更早的评论
a = {'fdf_faf' ; 'dfaf_dfa' ; 'dfadf_dfaf'; 'dfaf_fdaf';'daf_dfaf';'dfaf_fff'};
index = find(strncmpi(a,'dfaf',4))
index =
2
4
6
so above index string should be removed from cell array
How can i do this using cell fun or some other command?
Thanks a lot
0 个评论
采纳的回答
Mischa Kim
2015-7-1
Gopalakrishnan, use e.g. strrep
a = {'fdf_faf' ; 'dfaf_dfa' ; 'dfadf_dfaf'; 'dfaf_fdaf';'daf_dfaf';'dfaf_fff'};
arep = strrep(a,'dfaf','')
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!