How to write special characters into an Excel cell?
조회 수: 11 (최근 30일)
이전 댓글 표시
I'm trying to write the units of my table into the 2nd row of my Excel file. Below is the code:
writecell(T.Properties.VariableUnits,filename,'Range',"A2")
My question is how do I write special characters into the cells?
T1.Properties.VariableUnits = {'\circC', '\Omega', '\mumol/kg'};
Many thanks.
댓글 수: 0
채택된 답변
Sindar
2020년 8월 19일
If you can find the numeric code for the symbols, it should print with that. For example, this prints π | ϕ | μmol/kg
T1.Properties.VariableUnits = {char(960), char(981), [char(956) 'mol/kg']};
writecell(T1.Properties.VariableUnits,filename,'Range',"A2")
댓글 수: 3
Sindar
2020년 8월 19일
I do not. Usually, I'll do something like
char(900:1000)
and skim through the list, doing a rough binary search for the right number (that's how I found the ones above). Greek letters should be together and ordered, not sure where degree would be
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!