Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting comma to point

Tags:

matlab

I have a text file like this column wise:

0,472412
0,455627
0,439148
0,421753
...
0,116577
0,086670
0,057373
0,027161

How can I convert the comma into dot in matlab?

like image 942
liaquat85 Avatar asked Feb 19 '23 16:02

liaquat85


1 Answers

This post on Matlabs site suggests:

function comma2point_overwrite( filespec )
% replaces all occurences of comma (",") with point (".") in a text-file.
% Note that the file is overwritten, which is the price for high speed.
    file = memmapfile( filespec, 'writable', true );
    comma = uint8(',');
    point = uint8('.');
    file.Data( transpose( file.Data==comma) ) = point;
    delete(file)
end 
like image 152
Micha Wiedenmann Avatar answered Feb 28 '23 05:02

Micha Wiedenmann