Why Matlab does not show the special characters (e.g.: 'ç' or º)

Hello people,
My problem is, when I try to put special characters in matlab, it never shows the correct character.
e.g.: legend('Estação') is shows EstaÃSÃSo
What should I do ?

4 件のコメント

Açmae
Açmae 2013 年 8 月 8 日
編集済み: Açmae 2013 年 8 月 8 日
What is the character you are trying to write? Use the function CHAR() and use the extended ASCII code for the letter in question.
For instance:
>> char(231)
produces ç
Hence
>> strcat(['Esta' char(231) char(227) 'o'])
Produces
Estação
Daniel Shub
Daniel Shub 2013 年 8 月 9 日
@Açmae MATLAB on Windows does not support extended ASCII.
Arthur Melo
Arthur Melo 2013 年 8 月 9 日
@Açmae Thank you, it works so good. But it is a way to improvise. I want to fix this problem!!
Thank you very much!!
Arthur Melo
Arthur Melo 2013 年 8 月 11 日
@Açmae It works with letters but with symbols it doesn't work. Example: 167 --> º
>> char(167)
ans =
§
I don't know why :/

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

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 8 月 8 日

0 投票

Your example works for me on OS-X. What OS are you using? What font are you using?
Note: There is a different issue, which is that Unicode character positions beyond 255 will not work in MATLAB.

4 件のコメント

Arthur Melo
Arthur Melo 2013 年 8 月 9 日
I'm using Linux-Ubuntu. The font is UTF-8, I've tried changing it to ISO but It don't work. What can I do ?
Daniel Shub
Daniel Shub 2013 年 8 月 9 日
@Arthur, have you seen this question? Are your fonts working in general?
Arthur Melo
Arthur Melo 2013 年 8 月 11 日
I'm not understanding you. What fonts ?
Daniel Shub
Daniel Shub 2013 年 8 月 11 日
@Arthur can you change the size or type face of the font (e.g., in the legend or title)?

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

Daniel Shub
Daniel Shub 2013 年 8 月 9 日

0 投票

You may want to see this question. It appears that on Windows the windows-1252 character set is used while on Linux (and Mac) a different character set is used. As a work around you might be able to use the TeX/LaTeX interpreter.
legend({'Esta\c{c}\H{a}o'}, 'interpreter', 'latex')
Note that the {} around the string is needed in order to pass PV pairs (although the documentation is a little unclear about this).

カテゴリ

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

製品

質問済み:

2013 年 8 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by