Replace the element in the cell array with space inbetween
Afficher commentaires plus anciens
I have a cell array element = {'num riqu' ; 'num riqu' ; 'con tant' ; 'con tant'}
I need to replace num riqu = numeric
con tant = constant
how can I do this ?
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 6 Mai 2015
element = {'num riqu' ; 'num riqu' ; 'con tant' ; 'con tant'}
element=strrep(element,'num riqu','numeric');
element=strrep(element,'con tant','constant')
2 commentaires
Gopalakrishnan venkatesan
le 6 Mai 2015
Modifié(e) : Gopalakrishnan venkatesan
le 6 Mai 2015
Azzi Abdelmalek
le 6 Mai 2015
element = {'num riqu' ; 'num riqu' ; 'con tant' ; 'con tant'}
element=regexprep(element,'num riqu','numeric')
element=regexprep(element,'con tant','constant')
But strrep is faster then regexprep
Catégories
En savoir plus sur Variables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!