"xlswrite" Generates A Negative Number for This Line

조회 수: 1 (최근 30일)
Gary Leung
Gary Leung 2015년 8월 3일
댓글: Walter Roberson 2015년 8월 4일
Dear All,
I find that the following command line "xlswrite(['test.xlsx'],{'(100,100,100)'});" gives me a line of "-100,100,100" in the output "test.xlsx" file, which is not in accord with the input string. Could anyone tell me why this happens and how to fix it ?
Many thanks !
Best regards,
Gary

답변 (1개)

dpb
dpb 2015년 8월 3일
It's a fignewton of how Excel interprets the string; enclosed in the parentheses it apparently tries to convert to a numeric value and presumes the parens indicate a negative value. As for "how to fix", what do you want the result to be in Excel--that literal string, a negative currency, an array of three integers, ...?
  댓글 수: 2
Gary Leung
Gary Leung 2015년 8월 4일
thx dpb ! I would like it to be a literal string the same as "(100,100,100)".
Walter Roberson
Walter Roberson 2015년 8월 4일
Perhaps
xlswrite(['test.xlsx'],{'"(100,100,100)"'});

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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by