MATLAB xlswrite function

6 visualizaciones (últimos 30 días)
Stavros
Stavros el 28 de En. de 2011
Hello all MATLAB users:
This came to my attention,
>> x = [inf 3 4 inf];
>> xlswrite('test',x,'test');
if you open the .xls file you will notice that the inf value in xls is the "magic" number 65535.
Does anyone know the reason?

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 28 de En. de 2011
Because 2^16-1 is the largest number Excel can represent since it's 16 bit unsigned.
  2 comentarios
Kenneth Eaton
Kenneth Eaton el 28 de En. de 2011
Don't you mean unsigned 16 bit? ;)
Sean de Wolski
Sean de Wolski el 28 de En. de 2011
Oops, yup.

Iniciar sesión para comentar.

Más respuestas (2)

Kenneth Eaton
Kenneth Eaton el 28 de En. de 2011
The reason? Because the documentation says so! ;)
Excerpt:
  • Excel converts Inf values to 65535. MATLAB converts NaN values to empty cells.

Stavros
Stavros el 29 de En. de 2011
ty all :)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by