Entering Special Characters Such as Greek in Editor and Command Window?
26 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Brandon Luciano
am 3 Feb. 2018
Kommentiert: Walter Roberson
am 4 Feb. 2018
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.
0 Kommentare
Akzeptierte Antwort
Greg
am 4 Feb. 2018
Bearbeitet: Greg
am 4 Feb. 2018
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 Kommentar
Walter Roberson
am 4 Feb. 2018
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!