Converting .mat file with integer values to .dat causing wrong placement of the floating point
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am using Matlab R2018b. I have a mat file that looks like the following:
TimeSeries1 = [10 100; 11 101; 12 101; 13 102; etc] but longer and if I open I can see that the values seem correct
Col1 Col2
11 100
12 101
13 101
14 102
....
I tried to convert the .mat file to a .dat file as one of the algorithm I need to use requires a .dat file. So I did the following:
save TimeSeries1.dat TimeSeries1 -ascii
When i double clicked the dat file and opened it, it looks like this:
e00 e1
1.1 1.00
1.2 1.01
1.3 1.01
1.4 1.02
I don't understand why the '.' after the first character even though the data in the .mat file doesn't have that.
Do I do sth wrong?
Thanks for the help.
0 commentaires
Réponses (1)
Stephen23
le 6 Fév 2020
Modifié(e) : Stephen23
le 6 Fév 2020
save writes text files using exponential notation. If you don't want exponential notation, don't use save
In any case, using csvwrite or dlmwrite or writematrix or writetable etc. are preferred for writing text files. Or for full control over the file format, use low-level fprintf.
2 commentaires
Voir également
Catégories
En savoir plus sur Data Import and Export 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!