read replace decimals ,. commas to dot from txt files
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi there I am trying to import a file but the %%f%ff got commas as for decimals not possible to import if not had not written with dot. how can I replace thein in txt file?
댓글 수: 0
답변 (3개)
David Sanchez
2013년 7월 12일
The comma is an issue in Matlab, could you use dots instead?
-0.229447 0.003749 0.003599
-0.056431 2.009800 1.003600
-0.229128 0.004065 0.004236
-0.228810 0.004382 0.003599
If 'data.txt' is your containing file, the following should work:
fid = fopen('data.txt');
my_data = fscanf(fid, '%f %f %f', [3 4]);
fclose(fid);
댓글 수: 0
Hemanth Kumar Padmanaban
2015년 12월 14일
hallo friends, even i am facing the same Problem for conversion between european number System and International number System. I am trying with
strrep(t, ',','.');
but however ist not that suitable. kindly let me know if any one have found a better solution. Thanks
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!