xlswrite without losing precision

조회 수: 2 (최근 30일)
Susie
Susie 2013년 8월 23일
I have a cell array. When I use xlswrite to save them in an Excel file, it will lose precision at some decimal place. For example, if the cell is 191863214069, it will be 191860000000 in Excel.
What I want is to export data as exactly same as it is in Matlab. Anyone knows the solution?
Thanks!

답변 (1개)

Anand
Anand 2013년 8월 24일
You should not be seeing that. I tried the following and the Excel cell shows me the full value:
>> x
x =
1.9186e+11
>> xlswrite(filename,x)
When I open the Excel file I see the value of x with full precision. Maybe you didn't store the value as a double. Check the class of the variable you are exporting.
>> class(x)
  댓글 수: 2
Susie
Susie 2013년 8월 26일
Thanks. Well, I can see 1.9186e+11, but the point is the original should be 191863214069. I tried to convert it to multiple classes, but none of them worked...
Anand
Anand 2013년 8월 27일
Look at the cell value in the top cell and you will the value in full precision.

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by