Filter löschen
Filter löschen

"xlswrite" Generates A Negative Number for This Line

1 Ansicht (letzte 30 Tage)
Gary Leung
Gary Leung am 3 Aug. 2015
Kommentiert: Walter Roberson am 4 Aug. 2015
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

Antworten (1)

dpb
dpb am 3 Aug. 2015
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 Kommentare
Gary Leung
Gary Leung am 4 Aug. 2015
thx dpb ! I would like it to be a literal string the same as "(100,100,100)".
Walter Roberson
Walter Roberson am 4 Aug. 2015
Perhaps
xlswrite(['test.xlsx'],{'"(100,100,100)"'});

Melden Sie sich an, um zu kommentieren.

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by