How do I read commas as decimal points when reading a text file?
19 views (last 30 days)
Show older comments
Sam G. on 7 Apr 2011
Commented: Michael Haas on 8 Dec 2016
I have a file that I'm trying to read with numerical values that use commas as decimal points. For example...
0 21,875000 120,700000 0,000000
0 21.875000 120.700000 0.000000
I've used textscan to read and parse lines in other files.
line = fgetl(fid);
data = textscan(line,'%d %n %n %n',1,'delimiter','\n');
Can I get Matlab to recognize the commas as decimal points?
Paulo Silva on 7 Apr 2011
after reading the file replace the decimal points by commas
More Answers (0)
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!