필터 지우기
필터 지우기

1000 separator and decimal separator are both commas

조회 수: 3 (최근 30일)
Jimmy Neutron
Jimmy Neutron 2021년 4월 19일
답변: Walter Roberson 2021년 4월 19일
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'}

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 19일
str2double(regexprep(s, {',(?=.*,)', ','}, {'', '.'}))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by