replace the string a cell array with empty cell
2 views (last 30 days)
Show older comments
Gopalakrishnan venkatesan
on 7 May 2015
Commented: Iason Grigoratos
on 21 Dec 2016
I have a cell array a = {'abc' ; 'def' ; 'ghi' ; 'def' ; 'xyz'}
I need to replace a 'def' with empty cell.
so my answer should be a = {'abc' ; '' ; 'ghi' ; '' ; 'xyz'}
How can i do this using cell function?
thank you
0 Comments
Accepted Answer
Nobel Mondal
on 7 May 2015
You may directly use the strrep function
a = strrep(a, 'def', '');
2 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!