필터 지우기
필터 지우기

How to write character(39) to excel file?

조회 수: 11 (최근 30일)
Warakorn
Warakorn 2014년 4월 2일
편집: Friedrich 2014년 4월 2일
I used the following command
>> xlswrite('Test1.xlsx',char(39),1,'A1');
But when I open Test1.xlsx, I can't see any character in the excel file.
Could you tell me how to write char(39) into excel file?
I used the command below to see what character 39 is >> a = char(39)
a =
'
Thank you very much
OOO

채택된 답변

Friedrich
Friedrich 2014년 4월 2일
편집: Friedrich 2014년 4월 2일
Hi,
actually the character is written. It's an Excel display feature that it seems like its not there. But when you click at A1 and take a look at the upper text field in Excel (dont know how its called, but the thing which also displays the content of the cell which is currently selected) you will see the '. Basically a single apostrophe does not show up because Excel treats it as a Text marker and not part of the text stream. Enter two apostrophes to get the single quote in the text:
xlswrite('Test1.xlsx',{[char(39),char(39)]},1,'A1');

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 2일
편집: Azzi Abdelmalek 2014년 4월 2일
M={''''''};
xlswrite('Test1.xlsx',M,1,'A1');

카테고리

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