How can I use xlswrite to specifically write to a cell as text?
조회 수: 20 (최근 30일)
이전 댓글 표시
I'm trying to write the string '0E0' to an Excel spreadsheet using xlswrite. However, Excel interprets this as a number in scientific notation. The cell appears as the number 0 in the output spreadsheet, instead of as the text "0E0". There appears to be no way to recover the original text information once in Excel (changing number format to text leaves "0" as a string). I'd like it to remain a string through the xlswrite process, otherwise the information is lost. Is there a way to do this?
댓글 수: 0
채택된 답변
Brian B
2014년 6월 13일
I don't have MATLAB in front if me to test it, but you could try adding a single quote before the string, as in
xlswrite('a.xlsx', {'''0E0'})
This tells Excel to interpret the value as a string.
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!