I am trying to use matlab's csvwrite to write an array to a csv file. However, matlab writes the data in the format like 2.008e+09. I don't want it to write in the e+09 form but the whole number expanded. How can I do it?
csvwrite( filename , M ) writes matrix M to file filename as comma-separated values. csvwrite( filename , M , row , col ) writes matrix M to file filename starting at the specified row and column offset. The row and column arguments are zero based, so that row=0 and col=0 specify the first value in the file.
To export a table in the workspace to a Microsoft® Excel® spreadsheet file, use the writetable function. You can export data from the workspace to any worksheet in the file, and to any location within that worksheet. By default, writetable writes your table data to the first worksheet in the file, starting at cell A1 .
You can export a cell array from MATLAB® workspace into a text file in one of these ways: Use the writecell function to export the cell array to a text file. Use fprintf to export the cell array by specifying the format of the output data.
csvwrite
writes a maximum of 5 significant digits.
Use dlmwrite
instead :
dlmwrite('test.csv',your_data, 'precision', 9) ; % 9 significant figures.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With