Large integers saved as csv files are rounded up

조회 수: 14 (최근 30일)
Jacques Barsimantov
Jacques Barsimantov 2022년 7월 4일
답변: dpb 2022년 7월 4일
I have a very large data set called "el_inter" where the last numbers are very large integers. In Matlab,
el_inter(end-1) = 999964
el_inter(end-2) = 999963
clearly two different numbers (equivalent to cells 301689 and 301690 in the following Excel screenshots).
However, when I save it as a csv file using
csvwrite('el_inter.csv',el_inter')
The large integers are saved with scientific notation
in Excel then I change the format to general but it rounds the number so I get
Therefore, my data set has been altered and can't be used outside of Matlab.
How do I save all the data without rounding?
I have attached the data set variable.

채택된 답변

dpb
dpb 2022년 7월 4일
WAD. Per the doc csvwrite (NOT recommended, btw),
  • csvwrite writes a maximum of five significant digits....
Use writematrix instead, although if the point is to open the file in Excel, I'd strongly suggest to write an Excel .xlsx file to begin with and forego the CSV file entirely.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by