Losing precision when writing to Excel using xlswrite

Hi all, I have a matrix on MATLAB with a very percise values, such as: 2 .268073544251674e+03 but when converting to excel it only shows: 2268.1
I used the following command:
xlswrite('MatrixEvoUNSuc',EvoUnsuc)
Is there anyway I could make sure I don't lose that percision?
Thank you!!

Respuestas (1)

Ollie A
Ollie A el 31 de En. de 2019
It could be to do with the format of the excel cells. In excel you can increase the number of decimal places displayed.
Otherwise, I tried:
T = table(EvoUnsuc);
writetable(T,'MatrixEvoUNSuc.xls');
which seems to display the number to a higher precision.

8 comentarios

Hi. That gave me the following error. Any idea why?
Thanks
Error using writetable (line 142)
The data block starting at cell 'A1' exceeds the sheet boundaries by 1875539 row(s) and 0 column(s).
Ollie A
Ollie A el 31 de En. de 2019
Could you attach your matrix of data?
I wish. It's 25 MB and the other is 75 MB :(
Thanks for the kind help. It's so greatly appreciated!
Ollie A
Ollie A el 31 de En. de 2019
If your matrix has more than 1,048,576 rows then excel may not be able to support it.
Bullseye @Ollie A
Damn it :( But due to the nature of these numbers like: 2.268073544251674e+03 I get a weird spaceing between the columns (as I have millions of rows and dozens of columns) and it's not alligned once it prints the e+ numbers :(
Any idea how to work this?
Thank you guys
instead of writing it into one single file why not write in 3 separate files?
Ollie A
Ollie A el 31 de En. de 2019
I would try writing the data to a .dat or .txt file instead of .xls.
Reading the data back will be just as easy, and I'm sure the different file format will store all of your data.

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 31 de En. de 2019

Comentada:

el 31 de En. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by