How can I put a greek letter into an input sentence

3 Ansichten (letzte 30 Tage)
Georgia Acton
Georgia Acton am 7 Okt. 2016
Kommentiert: Walter Roberson am 9 Okt. 2016
So I need to set a variable, delta, by making it an input so I have
delta= input('\delta=');
but the text that is printed for the input is not the greek letter. I was wondering how I could make it so that it displays the symbol \delta opposed to the word. I've looked around on the internet and could honestly not find how to do it/ interpret responses to similar problems and translate them over (I'm a bit of a novice)
Many thanks :)

Antworten (1)

Marc Jakobi
Marc Jakobi am 7 Okt. 2016
input(char(948))
(look up ASCII tables for other letters).
  1 Kommentar
Walter Roberson
Walter Roberson am 9 Okt. 2016
This will work for some people, but people who are using a non-unicode font for the command window, and people using MS Windows with a Windows code page set to something that does not have that character (type typical Windows Code Page 1252 does not have it) might not be able to display the character in that way. Also, sufficiently old versions of MATLAB code not handle it.
If the version of MATLAB is sufficiently old (before about R2006b), then upgrading might be the solution.
When the font is a problem, the cure is to change the font in the Preferences.
When the active region is a problem, switching regions in the system preferences might fix the problem (but things don't always work out that well...)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by