writecell( [.... -inf inf ...] gives 65535 and 65535 in Excel both for -inf and +inf

조회 수: 13 (최근 30일)
Jos Indenkleef
Jos Indenkleef 2020년 8월 17일
답변: Maadhav Akula 2020년 8월 20일
table2cell(ToperLow)
ans =
1×5 cell array
{[650]} {[-Inf]} {[-Inf]} {[-Inf]} {[500]}
>> xx = table2cell(ToperLow)
xx =
1×5 cell array
{[650]} {[-Inf]} {[-Inf]} {[-Inf]} {[500]}
writecell( xx, 'test.xls', 'Sheet', 'sheet1', 'UseExcel', false )
Resulting cells in Excel is +65535 instead of - 65535???
650 65535 65535 65535 500
  댓글 수: 3
Binbin Qi
Binbin Qi 2020년 8월 18일
I think you can use string to instead of inf
dpb
dpb 2020년 8월 18일
For some purposes, maybe...a string in the column instead of numeric may break import and return as cellstr() though...not convenient.

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

답변 (1개)

Maadhav Akula
Maadhav Akula 2020년 8월 20일
Hi,
I believe this is how Excel treats Inf and -Inf in a cell, as @Binbin Qi mentioned one workaround would be to write them as strings as mentioned in the following post:
Also the documentation of xlswrite and writetable mention regarding this.
Hope this Helps!

카테고리

Help CenterFile Exchange에서 Data Export to MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by