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.

 採用された回答

Sindar
Sindar 2020 年 8 月 19 日

0 投票

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 件のコメント

Leon
Leon 2020 年 8 月 19 日
Many thanks! Do you know where I can find a list of the special characters with their Char numbers?
Sindar
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
Leon
Leon 2020 年 8 月 19 日
Many thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Characters and Strings についてさらに検索

製品

リリース

R2020a

タグ

質問済み:

2020 年 8 月 19 日

コメント済み:

2020 年 8 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by