How to show greek letters on a Simulink block with a mask?

39 vues (au cours des 30 derniers jours)
Mohamed Abdullah
Mohamed Abdullah le 9 Mai 2020
Hi, I am writing the name of a block in Simulink .I created a mask to display the name.the name of the block contains a greek character.I tried the same matlab method used in graphs to display the greek letter in the name of the block,but it didn't work out. is there anyway to show greek letters in the name of the block?
the line of code I used for the mask :
disp(sprintf('side-slip\nangle Observer {\beta}'))
Thanks in advance

Réponse acceptée

Monika Phadnis
Monika Phadnis le 12 Mai 2020
You can use ASCII code values of greek letters to display them as characters.
For example, try adding the following code in your mask's 'Icon drawing commands' section:
>> fprintf("%c", 945) %945 is the ASCII value for lowercase alpha
Another function that can be used to get the greek letter is 'char' followed with 'disp' function.
For example, try adding the following code in your mask's 'Icon drawing commands' section:
>> disp(char(946)) %946 is ASCII value for lowercase beta
Similarly, you can use ASCII values for different greek letters.
You can refer this link for getting the various ASCII values:
On this page, the number part of the 'Entity' column can be substituted in the ways described above for obtaining the greek letter.

Plus de réponses (0)

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by