how to remove last characther from cell array of string
Afficher commentaires plus anciens
Hi All, let's say i have this cell array of string:
test={'1234T'; '4567T'; '8901T'};
Is the a way to remove the last character T on every cell using this kind of command:
test=test{:}(1:end-1);
If not what is the best way to do it without loop? Cheers Medie
2 commentaires
Mederic Mainson
le 22 Sep 2016
Walter Roberson
le 22 Sep 2016
It is a good way. Depending how large the array is, it is possible that regexprep might be faster on large matrices; I would need to benchmark to verify that though.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!