3

I'm trying to write Inf and -Inf using xlswrite in Matlab. But value I'm getting in the xls is 65535 for both. Why is this happening?

Nish
  • 51
  • 6

1 Answers1

3

There is an issue with the types of the value you want to store in a cell in Excel. First, Excel does not have any inf value (see here). If you wish to store a large number, you can use e.g.

xlswrite('test.xls', 1e99, 1, 'A1')

however, at some point, Excel does simply go back to 65535, if you use e.g.

xlswrite('test.xls', 1e9999, 1, 'A1') % gives you 65535 in Excel

A quick check yielded (MATLAB R2013b), that the largest number is 1e308, so

xlswrite('test.xls', 1e308, 1, 'A1')
Community
  • 1
  • 1
rst
  • 2,510
  • 4
  • 21
  • 47