MATLAB xlswrite function

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?

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 1월 28일

0 개 추천

Because 2^16-1 is the largest number Excel can represent since it's 16 bit unsigned.

댓글 수: 2

Kenneth Eaton
Kenneth Eaton 2011년 1월 28일
Don't you mean unsigned 16 bit? ;)
Sean de Wolski
Sean de Wolski 2011년 1월 28일
Oops, yup.

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

추가 답변 (2개)

Kenneth Eaton
Kenneth Eaton 2011년 1월 28일

1 개 추천

The reason? Because the documentation says so! ;)
Excerpt:
  • Excel converts Inf values to 65535. MATLAB converts NaN values to empty cells.
Stavros
Stavros 2011년 1월 29일

0 개 추천

ty all :)

카테고리

Community Treasure Hunt

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

Start Hunting!

Translated by