Effacer les filtres
Effacer les filtres

1000 separator and decimal separator are both commas

3 vues (au cours des 30 derniers jours)
Jimmy Neutron
Jimmy Neutron le 19 Avr 2021
I am working with data that has some numbers that have two commas as separators and thus when I replace them with dots, matlab throws me an error.
Is it possible to remove only the 1000 separator comma in these numbers?
s = {'801,24','-594,041','97,263';'799,187','-592,496','97,413';'1,201,618','-458,342','98,11';'1,200,226','-457,107','98,187'}

Réponse acceptée

Walter Roberson
Walter Roberson le 19 Avr 2021
str2double(regexprep(s, {',(?=.*,)', ','}, {'', '.'}))

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by