Csvwrite with numbers over 7 digits

So, I have a file that is designed to be analyzed through a rather large csv file, in order to weed out several data points. Listed below are three values ​​(out of 400,000+) in the file:

Vehicle_ID  Frame_ID    Tot_Frames  Epoch_ms    Local_X
2           29          1707        1163033200  8.695
2           30          1707        1163033300  7.957
2           31          1707        1163033400  7.335

What I'm trying to do here is to take previously filtered data points like this and connect it to another CSV file using csvwrite. However, csvread will only accept Epoch_ms in double precision, storing the value as 1.1630e + 09, which is sufficient for reading, since it supports the original value of the number used in MATLAB operations.

However, during csvwrite, this accuracy is lost, and each data point is written as 1.1630e9.

How do I get csvwrite to handle a number with greater precision?

+5
source share
1 answer

Use dlmwrite with an argument of precision, for example %i. By default, the delimiter is a comma, like a CSV file.

dlmwrite(filename, data, 'precision', '%i')
+9
source

All Articles