フィルターのクリア

Entering Special Characters Such as Greek in Editor and Command Window?

13 ビュー (過去 30 日間)
Brandon Luciano
Brandon Luciano 2018 年 2 月 3 日
コメント済み: Walter Roberson 2018 年 2 月 4 日
So I am trying to insert a special greek character in my .m script file to be displayed in the command window.
I tried using /omega but the character doesn't display. Here is the code where I am trying to use the actual symbol.
omegavalue = input('Enter the value of /omega');
How can I fix this? I am new to MATLAB programming language.

採用された回答

Greg
Greg 2018 年 2 月 4 日
編集済み: Greg 2018 年 2 月 4 日
According to the documentation for sprintf, you can display any Unicode character with "\x" followed by its hex value. Then pass it into input:
input(sprintf('\x03c9'))
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 2 月 4 日
This requires R2014b or later; before that it typically did not work on MS Windows (but sometimes did). I am not positive it worked even with R2014b on MS Windows for certain.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by