replace the string a cell array with empty cell

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Nobel Mondal
Nobel Mondal il 7 Mag 2015
You may directly use the strrep function
a = strrep(a, 'def', '');

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by